# Statistical Software: R Koujue

This guide contains resources to assist faculty, researchers, staff, and students in learning statistical software, such as R, Python, SAS, Stata, SPSS

## Quick Tips

R commands are case-sensitive.

# comment follows.

<- or = is assignment operator.

c is used to concatenate.

demo() is used to see what R can do.

ls() lists existng objects in R.

help() displays the help manual for a command.

str() gets structure of a dataset.

save() data in an R data file.

rm() removes objects.

class() lists the type of an object.

mean() calculates the mean.

median() calculates the median.

sd() calculates the standard deviation.

cor() calculates correlations.

summary() is a generic function which provides a summary results of an object.

by() is used to apply a function to a data frame split by factors.

tapply() is used to apply a function to each cell of an array.

hist() is used to draw a histogram plot.

boxplot() is used to draw a box plot.

table() is used to generate a frequency table.

rbind() combines rows of data.

cbine() combines columns of data.

merge() is used to match-merge two data frames.

t.test() can conduct one sample, two sample and paired t-tests.

lm() fits a lienar model (regression).

anova() extracts the anova table from a lm object.

glm() is used for generalized lienar models.

wilcox.test() is a non-parametric analog to the indepndent two-sample t-test.

kruskal.test() is a non-parametric analog to the one-way anova.

## STATS HOME Jianjun Hua
Contact:
Dartmouth College

Hanover NH 03755

## QUESTIONNAIRE

This guide has a user friendly interface.

QUESTIONNAIRE