WHT

How To Make A Table In R Studio | Rstudio Basics | Creating Tables In Rstudio

Raffycee

Subscribe Here

Likes

39

Views

7,753

Rstudio Basics | Creating Tables In Rstudio

Transcript:

Hi, in this video, I will be teaching you how to create tables in rstudio. Before we start. You must first Download the sample data set. The link is in the description below after downloading the data. Let’s upload this into our studio first open rstudio and go to file new file and our script, then in the source window type, the code Data1 Readcsv filechoose header is equal to true highlight the code and press ctrl. Enter, locate the file and we’re done with this. The dataset is now stored in data1 to view it. Click the object in the environment or history window. This is an actual data from a research conducted in Davao City, with 100 respondents and contains seven variables, namely sex, which is a categorical variable with two levels, male or female age, which is a categorical variable with five levels 20-25 26 to 30 31 to 35 36 to 40 and above 40 educational attainment, which is a categorical variable with three levels, elementary level, high school level and college level proactiveness, which is a numerical variable that describes the respondent’s willingness to work innovativeness, which is a numerical variable that describes the respondent’s willingness to introduce new products and procedures risk taking, which is a numerical variable that describes if the respondents are actively willing to take risks while understanding and evaluating these risks and opportunity evaluation, which is a numerical variable that describes how well, the respondents evaluate opportunities, proactiveness innovativeness risk taking and opportunity evaluation were achieved by getting the average of the responses to the five statements under each indicator, using this data set, lets create frequency and percentage tables, frequency and percentage tables, display counts and percentages for each distinct value found in a variable respectively. We usually use this to describe categorical variables to get the frequency and percentage table of a variable using rstudio. We will use the table and proptable functions, respectively, object1 in each function contains the variable You want to use to create the tables. Also you need to know. The column name used to describe that variable in your data, for example, the sex variable, which can be found in Data1, has a column name of sex so to call the sex variable. You must type Data 1. Dollar sign sex highlight the code and click ctrl enter and you will see the entire data set under this variable similarly to call age and educational attainment, type data 1. Dollar sign, age and data, one dollar sign educational attainment, Remember that Rstudio is case sensitive notice that E and a are capitalized, whereas the two words are separated by a dot. Because when you look at Data 1. This is how it was typed in our data set. Let’s try to create frequency and percentage tables for variable sets to do so simply type the code table open parenthesis, data1 dollar sign, sex and prop that table open parenthesis, table open parenthesis, data 1. Dollar sign sex. At the end type asterisk 100 This allows us to multiply each number by 100 highlight these two lines of codes and press ctrl enter in the console or terminal window. You will see the result. There are 23 females, which is 23 percent and 77 males, which is 77 percent. I encourage you to pause the video and try to get the frequency and percentage table for age to get the frequency and percentage for age, simply type the code’s table open parenthesis, data1 dollar sign, h and prop that table open parenthesis, table open parenthesis, data1 dollar sign age in this case, lets. Try to skip the times 100 in this code, highlight the codes and press ctrl enter, and you will see the result in the console window notice that the percentages are expressed in decimal. If you were not able to see the result, and you get some errors, check the spelling capitalization and the syntax of your code. This will solve most of the problem again. Rstudio is case sensitive. Next we will create contingency tables in Rstudio. Contingency tables also called Crosstabs or two-way tables, are used to summarize the relationship between several categorical variables. A contingency table is a special type of frequency distribution table, where two variables are shown simultaneously to create one in rstudio. We will use the x-stub’s function. Variable 1. And variable 2 will be replaced by the object that contains the two variables that you will use whereas object 1. Is where these variables are stored. Suppose you want to create a contingency table for sex and age? These variables are stored in data 1. To do that simply type X tabs open parenthesis, the tilde. Sign located at the upper left corner of your keyboard, just below the escape button, type sex, plus age comma and data1. If you were not able to see the results and you get some errors, check the spelling capitalization and the syntax of your code make sure that S and a in sex and age respectively, are capitalized because that is how it was named inside Data1. This will solve most of the problem again. I encourage you to pause the video and try to get the contingency table for sex and educational attainment to get the contingency table for sex and educational attainment, simply type the code X tabs open parentheses, the tilde. Sign sex, plus educational attainment, comma data1 and close parenthesis. Make sure that there is no space in between educational and attainment and they are separated by a dot highlight the code and press ctrl enter in the console window. You will see the results. That’s how you create frequency percentage and contingency tables in rstudio. In the next video. I will demonstrate to you how to create graphs in Rstudio. Thank you very much.

0.3.0 | Wor Build 0.3.0 Installation Guide

Transcript: [MUSIC] Okay, so in this video? I want to take a look at the new windows on Raspberry Pi build 0.3.0 and this is the latest version. It's just been released today and this version you have to build by yourself. You have to get your own whim, and then you...

read more