Regr {MVar} | R Documentation |
Linear regression.
Description
Performs linear regression on a data set.
Usage
Regr(Y, X, namevarx = NA, intercept = TRUE, sigf = 0.05)
Arguments
Y |
Variable response. |
X |
Regression variables. |
namevarx |
Name of the variable, or variables X, if not set, assumes the default text. |
intercept |
Consider the intercept in the regression (default = TRUE). |
sigf |
Level of significance of residue tests(default = 5%). |
Value
Betas |
Regression coefficients. |
CovBetas |
Covariance matrix of the regression coefficients. |
ICc |
Confidence interval of the regression coefficients. |
hip.test |
Hypothesis test of the regression coefficients. |
ANOVA |
Regression analysis of the variance. |
R |
Determination coefficient. |
Rc |
Corrected coefficient of determination. |
Ra |
Adjusted coefficient of determination. |
QME |
Variance of the residues. |
ICQME |
Confidence interval of the residue variance. |
prev |
Prediction of the regression fit. |
IPp |
Predictions interval |
ICp |
Interval of prediction confidence |
error |
Residuals of the regression fit. |
error.test |
It returns to 5% of significance the test of independence, normality and homogeneity of the variance of the residues. |
Author(s)
Paulo Cesar Ossani
References
Charnet, R.; at al.. Analise de modelos de regressao lienar, 2a ed. Campinas: Editora da Unicamp, 2008. 357 p.
Rencher, A. C.; Schaalje, G. B. Linear models in statisctic. 2th. ed. New Jersey: John & Sons, 2008. 672 p.
Rencher, A. C. Methods of multivariate analysis. 2th. ed. New York: J.Wiley, 2002. 708 p.
See Also
Examples
data(DataMix)
Y <- DataMix[,2]
X <- DataMix[,6:7]
name.x <- c("Special Coffees", "Commercial Coffees")
res <- Regr(Y, X, namevarx = name.x , intercept = TRUE, sigf = 0.05)
print("Regression Coefficients:"); round(res$Betas,4)
print("Analysis of Variance:"); res$ANOVA
print("Hypothesis test of regression coefficients:"); round(res$hip.test,4)
print("Determination coefficient:"); round(res$R,4)
print("Corrected coefficient of determination:"); round(res$Rc,4)
print("Adjusted coefficient of determination:"); round(res$Ra,4)
print("Tests of the residues"); res$error.test