Basic stats (summary stats, etc.)

R contains all the basic tools for calculating summary statistics of your data: many of them are listed in the R reference cards. If you have NAs in your data you will often have to specify na.rm = TRUE (e.g., mean(x, na.rm = TRUE)) if you want R to ignore them.

  • mean(), median(), sum(), var(), min(), max(), range() should all be reasonably self-explanatory
  • cor(), cov() calculate covariances and correlations
  • mad() calculates the mean absolute deviation
  • quantile() computes various quantiles of your data
  • for numeric variables, summary() computes min/max/1st and 3d quantiles/median/mean.
  • See the Modal Value page for calculating the modal value (mode).

If you are looking for t-tests, ANOVAs, linear regression, etc., see Inference or Models.

Full content (page names)

 
tips\stats-basic.txt · Last modified: 2007/01/11 by cornelius1729
 
Recent changes RSS feed R Wiki powered by Driven by DokuWiki and optimized for Firefox Creative Commons License