R Linguistic statistical analysis-variance analysis

Source: Internet
Author: User
Tags square root

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.