ltContrast | R Documentation |
Calculates linear trend contrast coefficients according to 4.2.4.
ltContrast(f)
f |
A factor. |
# example 4.23
is.factor(heartlung.pump$RPM) # TRUE
ltc <- ltContrast(heartlung.pump$RPM)
afr <- with(heartlung.pump, tapply(Y,RPM, mean))
# least squares estimate of linear contrast:
crossprod(afr,ltc)
# get msE:
lmHL <- lm(Y ~ RPM, heartlung.pump)
msE <- summary(lmHL)$sigma^2
# estimated standard error of the linear trend estimator:
sqrt(msE * sum(ltc^2/table(heartlung.pump$RPM)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.