LSest {mffSM} | R Documentation |
It calculates the least squares estimates of the estimable parameters of a linear model including their standard errors and confidence intervals. It also performs the linear model based t-tests of hypotheses of equality of the estimable parameters to given values. Provided p-values and confidence intervals are calculated as if each parameter is estimated/tested separately from the others, i.e., no corrections for multiple testing are considered.
LSest(x, L, alternative = c("two.sided", "less", "greater"), conf.level = 0.95, theta0 = 0) ## S3 method for class 'LSest' print(x, ...)
x |
an object of class |
L |
either a numeric vector or a numeric matrix. If it is a vector, it provides the coefficients of the linear combination that determines the estimable parameter of the linear model to estimate and test. If it is a matrix then each row provides the coefficients of the linear combination that determines the estimable paramaters of the linear model to estimate and test. |
alternative |
a character string specifying the alternative hypothesis for all tests being performed, must be one of “two.sided” (default), “greater” or “less”. You can specify just the initial letter. |
conf.level |
confidence level of the intervals. |
theta0 |
either a single number or a vector of length equal to the number of estimable parameters being estimated/tested. The single number is recycled into such a vector. It determines the values of each estimable parameter being estimated/tested under the null hypothesis. |
... |
additional arguments passed to the |
A list
with: estimates, standard errors, test statistics
from the t-tests, p-values and lower and upper limit of the confidence
intervals.
Arnošt Komárek arnost.komarek[AT]mff.cuni.cz
### ANOVA model data(Cars2004, package = "mffSM") m1 <- lm(consumption ~ fdrive, data = Cars2004) summary(m1) ### Estimate group differences for each pair L <- matrix(c(0, 1, 0, 0, 0, 1, 0, -1, 1), ncol = 3, byrow = TRUE) colnames(L) <- names(coef(m1)) rownames(L) <- c("rear-front", "4x4-front", "4x4-rear") LSest(m1, L = L) ### One-sided tests with different null hypothesis value ### for each test LSest(m1, L = L, alternative = "greater", theta0 = c(1, 2.5, 1))