Description Usage Arguments Value Author(s) See Also Examples

View source: R/linest_compute.R

Compute linear estimates for a range of models. One example of linear estimates is population means (also known as LSMEANS).

1 2 3 4 5 6 7 8 9 10 11 12 13 |

`object` |
Model object |

`...` |
Additional arguments; currently not used. |

`L` |
Either |

`level` |
The level of the (asymptotic) confidence interval. |

`parm` |
Specification of the parameters estimates for which confidence inctervals are to be calculated. |

A dataframe with results from computing the contrasts.

Søren Højsgaard, [email protected]

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ```
## Make balanced dataset
dat.bal <- expand.grid(list(AA=factor(1:2), BB=factor(1:3), CC=factor(1:3)))
dat.bal$y <- rnorm(nrow(dat.bal))
## Make unbalanced dataset
# 'BB' is nested within 'CC' so BB=1 is only found when CC=1
# and BB=2,3 are found in each CC=2,3,4
dat.nst <- dat.bal
dat.nst$CC <-factor(c(1,1,2,2,2,2,1,1,3,3,3,3,1,1,4,4,4,4))
mod.bal <- lm(y ~ AA + BB * CC, data=dat.bal)
mod.nst <- lm(y ~ AA + BB : CC, data=dat.nst)
L <- LE_matrix(mod.nst, effect=c("BB", "CC"))
linest( mod.nst, L )
``` |

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.