Learn R Programming

sla (version 0.1)

sla-package: Two-Group, Straight-Line ANCOVA

Description

Fits four linear models ("A", "B", "C", and "D") for the two-group, straight-line ANCOVA problem. (A) Model "A", the full model - fits two intercepts and two slopes (separate intercepts and slopes for each group); (B) Model "B", a reduced model - fits single intercept and single slope to all the data (ignoring group designation); (C) Model "C", a reduced model - fits two different intercepts and a single, common slope; (D) Model "D", a reduced model - fits a single, common intercept and two different slopes.

Arguments

Details

Package:
sla
Type:
Package
Version:
1.0
Date:
2014-08-24
License:
GPL-2
The 'sla' function fits four linear models ("A", "B", "C", and "D"), described above, in connection with the two-group, straight-line ANCOVA problem. The 'print' function produces directly interpretable coefficients (intercepts and slopes) for each model "A", "B", "C", and "D". The 'summary' function presents two tables. The top table displays the number of parameters fit, the residual degrees of freedom, the residual sum of squares, and the residual mean square for each model "A", "B", "C", and "D". The bottom table displays reductions in sums of squares, F statistics, and probabilities associated with models "B", "C", and "D",respectively, vs. model "A", thus testing for three null hypotheses: (1) equivalence of the data sets for the two groups, (2) equivalence of slopes for the two groups, and (3) equivalence of intercepts for the two groups.

References

Dalgaard P (2002) Introductory Statistics with R. Springer. Draper NR and Smith H (1998) Applied Regression Analysis. 3rd ed. Wiley. Fox J (2008) Applied Regression Analysis and General Linear Models, 2nd ed. Sage. Fox J and Weisberg S (2011) An R Companion to Applied Regression, 2nd ed. Sage. Searle SR (1971) Linear Models, Wiley. Venables WN and Ripley BD (2002) Modern Applied Statistics with S. 4th ed. Springer.

Examples

Run this code
data(eqslo)
eqsloObj <- sla(eqslo)
eqsloObj
summary(eqsloObj)
attributes(eqsloObj)
eqsloObj$Mod.C # best fitting reduced model, equivalent slopes, different intercepts
summary(eqsloObj$Mod.C) # lm summary of Model C
plot(eqsloObj, mod = 'C') # plot of data eqslo, fitted lines with equal slopes, different intercepts

Run the code above in your browser using DataLab