# # # ####### Checking out package 'prettyR'. ####### # # Library necessary for importing SPSS files. library(foreign) # Import the example data. example.1 <- read.spss("http://www.unt.edu/rss/class/Jon/R_SC/Module3/ExampleData1.sav", use.value.labels=TRUE, max.value.labels=Inf, to.data.frame=TRUE) # The ubiquitous 'summary' function summary(example.1) # Load the 'prettyR' library. library(prettyR) # The describe function for descriptive statistics. describe(example.1) describe(example.1$Recall1) describe(example.1$Distraction) # The breakdown function for descriptive statistics among groups. brkdn(Recall2 ~ Sex, example.1) brkdn(Recall1 ~ Distraction, example.1) brkdn(Recall1 ~ Candy + Distraction, example.1) # The frequencies function. freq(example.1) freq(example.1$Ethnicity) freq(example.1$Recall2) # Skew function returns the skewness. skew(example.1$Recall2) # The cross-tabs function with chi-square (odds ratio and phi also available for 2 X 2 tables). xtab(Sex ~ Cl_St, data = example.1) xtab(Candy ~ Distraction, data = example.1, chisq = TRUE) calculate.xtab(example.1$Candy, example.1$Distraction) # 2 Dec. 2010 # END