8/8/2023 0 Comments Rstudio summary statistics![]() We will cover this in a later section of this tutorial.ĬreateTableOne( data = demo, vars = c( "Gender", "Age", "Race", "Education"), factorVars = c( "Gender", "Race", "Education") ) #Īs we can see, this tableone that we just created should look somewhat familiar to the table that we created above. There is a way that we can force tableone to show all categories of a variable. For this reason, we can infer the count and percentage of the other category just based on the one that tableone gives us. This is because this variable only has two levels: Female and Male. You may have also noticed that “Female” is the only gender that is shown in this table. In addition, we are also given the count and percentage of each category! However, instead of a single mean and standard deviation for gender, race, and education, we now have all of the categories of these variables fleshed out. The count of records (n) is still there and we are still provided with the mean and standard deviation of participants’ age. # High school graduate/GED or equi 1303 (22.6) # Other Race - Including Multi-Rac 470 ( 4.6) (tab_nhanes <- CreateTableOne( data = demo_translate)) # # SDMVPSU SDMVSTRA INDHHIN2 INDFMIN2 INDFMPIRĪs we can see, the data is quite overwhelming! Let’s only select a few familiar variables to make the summary a bit more manageable and comprehensible. # DMDHRGND DMDHRAGE DMDHRBR4 DMDHREDU DMDHRMAR DMDHSEDU WTINT2YR WTMEC2YR # MIAPROXY MIAINTRP AIALANGA DMDHHSIZ DMDFMSIZ DMDHHSZA DMDHHSZB DMDHHSZE # DMDMARTL RIDEXPRG SIALANG SIAPROXY SIAINTRP FIALANG FIAPROXY FIAINTRP MIALANG # RIDEXAGM DMQMILIZ DMQADFC DMDBORN4 DMDCITZN DMDYRSUS DMDEDUC3 DMDEDUC2 Head(demo_original) # SEQN SDDSRVYR RIDSTATR RIAGENDR RIDAGEYR RIDAGEMN RIDRETH1 RIDRETH3 RIDEXMON 9.7 Tutorial 8: Data Summary with tableone.9.6 Tutorial 7: Date and Time Data with lubridate.9.5 Tutorial 6: Data Visualization with ggplot2.9.4 Tutorial 5: Data Analysis with dplyr. ![]() 9.2 Tutorial 3: Importing Data into R with readr.8.6.3 Show Categorical or Continuous Variables Only.8.6 Other Arguments to Customize tableone.8.5.3 Solution 2: Identify Numerical Categorical Data.8.5.2 Solution 1: nhanesTranslate & CreateTableOne.7.8.2 Account for Leap Years and Daylight Savings.7.8 Arithmetic Operators with Date/Time.7.6 Retrieving Information from Date/Time Data.6.5 Multiple Geometric Functions under one ggplot.5.12 Translating NHANES using case_when().5.10 Summary of dealing with missing values.4.5.2 Alternative ways to download NHANES.4.5 Importing NHANES dataset from R package: nhanesA.4.4 Importing NHANES dataset from website.3.6.4 Statistical Analysis Software (SAS).3.4.3 Key Notes About Importing Data into R. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |