View source: R/anova_related.R

Analysis of covariance | R Documentation |

Analysis of covariance

```
ancova1(y, ina, x, logged = FALSE)
```

`y` |
A numerical vector with the data, the response variable. |

`ina` |
A numerical vector with 1s, 2s, 3s and so one indicating the two groups. Be careful, the function is desinged to accept numbers greater than zero. |

`x` |
A numerical vector whose length is equal to the number of rows of y. This is the covariate. |

`logged` |
Should the p-values be returned (FALSE) or their logarithm (TRUE)? |

Analysis of covariance is performed. No interaction between the factor and the covariate is tested. Only the main effects. The design need not be balanced. The values of ina need not have the same frequency. The sums of squares have been adjusted to accept balanced and unbalanced designs.

A matrix with the test statistic and the p-value for the factor variable and the covariate.

Michail Tsagris

R implementation and documentation: Michail Tsagris <mtsagris@uoc.gr> and Manos Papadakis <papadakm95@gmail.com>.

D.C. Montgomery (2001). Design and analysis of experiments (5th Edition). New York: John Wiley & Sons

```
ancovas, ftests, ttests, anova1
```

```
y <- rnorm(90)
ina <- rbinom(90, 2, 0.5) + 1
x <- rnorm(90)
a <- ancova1(y, ina, x)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.