R has a number of built in statistical functions including those that most of you are probably familiar with.
mean(x) - computes the mean of a list of numberss
sd(x) - standard deviation of a list
var(x)- variance of a list
range(x) ,min(x), max(x) -range of values, minimum, and maximum in a list
quantile(x,p) - smallest value of x that corresponds to p proportion of list (e.g,. quantile(x,0.1) returns a value basically > 10% of the list values)
and many others such as t-tests, test of proportions, etc.
In addition to these, R also has built in distribution and random number functions for many common statistical distributions. The most important for this course will be
Normal -- for continuous random variables
Poisson - for counts
Binomial (Bernoulli) - for events that occur as binary outcomes
For each of these distributions there are corresponding built -in R functions that
Generates the probability density for value of x
E.g., dnorm(5,mean=0,sd=100) gives f(5) , the probability density for the value of 5 from normal with mean =0 and sd=100
Produces the cumulative probability that X<x
E.g,. pnorm(5,0,100) gives the probability that X<5 for the above normal
Produces the quantile or value of x associated with p cumulative probability
qnorm(.75,mean=0,sd=100) gives the value x that is > 75% of the above distribution
Produces a list of random numbers from the distributions
rnorm(100,mean=0,sd=100) will produces 100 random numbers from a normal with mean=0 and sd=100
Corresponding functions exist Poisson (dpois, ppois,qpois, rpois) and binomial (dbinom etc). See ?[function] to get html help and examples