#REMEMBER TO DOWNLOAD ISwR PACKAGE #LOAD ISwR PACKAGE require(ISwR) #LOAD cystfibr DATA FROM ISwR data(cystfibr) attach(cystfibr) #SPECIFY FULL & REDUCED MODELS FM=lm(pemax~age+sex+height+weight+bmp+fev1+rv+frc+tlc) RM=lm(pemax~age+sex+weight+bmp) #FOR REGRESSION COEFFICIENTS (Estimate): #FOR OVERALL F TEST OF REGRESSION: #FOR PARTIAL t TESTS OF SINGLE COEFFICIENTS: #FOR R-SQUARED OR R AND ADJUSTED R-SQUARED summary(FM) #FOR ANOVA TABLE INCLUDING PARTIAL SUMS OF SQUARES #THAT ADD TO THE REGRESSION SUM OF SQUARES #FOR RESIDUAL/ERROR SUM OF SQuARES: #FOR F TESTS OF SERIALLY ADDED INDEPENDENT VARIABLES: anova(FM) #FOR GLM TEST OF FULL VS REDUCED MODELS anova(FM,RM) #FOR CONFIDENCE AND PREDICTION INTERVALS: predict(FM,interval="confidence",level=0.95) predict(FM,interval="prediction",level=0.95)