R Linguistic statistical analysis-variance analysis
A simple example of variance analysis
Test the effect of insecticide in 6, the target value is the number of insects, the other side of the analysis.
1. Import data
Data (Insectsprays)
2. Square root conversion, analysis
Aov.spray <-AoV (sqrt (count) ~ Spray, data = insectsprays)
AoV () left is the corresponding variable on the left and the right predictor variable.
Equivalent to
> Aov.spray <-aov (sqrt (insectsprays$count) ~ insectsprays$spray)
Know the number
> Aov.spray <-aov (sqrt (insectsprays[, 1]) ~ insectsprays[, 2])
3. View Details
> Aov.spray
Call:
AoV (formula = sqrt (count) ~ Spray, data = insectsprays)
Terms:
Spray residuals
Sum of Squares 88.43787 26.05798
Deg. of Freedom 5 66
Residual standard error:0.6283453
Estimated effects may be unbalanced
>summary (Aov.spray)
Df Sum Sq Mean sq F value Pr (>f)
Spray 5 88.44 17.688 44.8 <2e-16 * * *
Residuals 66 26.06 0.395
---
Signif. codes:0 ' * * * ' 0.001 ' * * ' 0.01 ' * ' 0.05 '. ' 0.1 "1
4. Show Analysis Results
Opar <-par ()
Par (Mfcol = C (2, 2))
Plot (Aov.spray)
Par (OPAR)
Opar <-par ()
Par (Mfcol = C (2, 2))
Plot (Aov.spray)
Par (OPAR)
Termplot (Aov.spray, Se=true, Partial.resid=true, Rug=true)
The meaning of statistical function operators
Three, simple generics
Generic functions
Four, the package
Base Package
Recommended Packages
Install package
Download the required package and let the system console enter the R CMD INSTALL gee_4.13-6.tar.gz;
Management Pack
> update.packages () update package
installed. packages, cran.packages,download.packages;
R Linguistic statistical analysis-variance analysis