Different parametrization
Load packages
library(ISwR)
Analyze
data(cystfibr)
## Create a -1,+1 coded sex2
cystfibr$sex2 <- cystfibr$sex
cystfibr$sex2[cystfibr$sex2 == 0] <- -1
head(cystfibr)
## age sex height weight bmp fev1 rv frc tlc pemax sex2
## 1 7 0 109 13.1 68 32 258 183 137 95 -1
## 2 7 1 112 12.9 65 19 449 245 134 85 1
## 3 8 0 124 14.1 64 22 441 268 147 100 -1
## 4 8 1 125 16.2 67 41 234 146 124 85 1
## 5 8 0 127 21.5 93 52 202 131 104 95 -1
## 6 9 0 130 17.5 68 44 308 155 118 80 -1
## 0/1
summary(lm(pemax ~ age + sex + height + weight + bmp + fev1 + rv + frc + tlc, data = cystfibr))
##
## Call:
## lm(formula = pemax ~ age + sex + height + weight + bmp + fev1 +
## rv + frc + tlc, data = cystfibr)
##
## Residuals:
## Min 1Q Median 3Q Max
## -37.34 -11.53 1.08 13.39 33.41
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 176.058 225.891 0.78 0.45
## age -2.542 4.802 -0.53 0.60
## sex -3.737 15.460 -0.24 0.81
## height -0.446 0.903 -0.49 0.63
## weight 2.993 2.008 1.49 0.16
## bmp -1.745 1.155 -1.51 0.15
## fev1 1.081 1.081 1.00 0.33
## rv 0.197 0.196 1.00 0.33
## frc -0.308 0.492 -0.63 0.54
## tlc 0.189 0.500 0.38 0.71
##
## Residual standard error: 25.5 on 15 degrees of freedom
## Multiple R-squared: 0.637, Adjusted R-squared: 0.42
## F-statistic: 2.93 on 9 and 15 DF, p-value: 0.032
## -1/+1
summary(lm(pemax ~ age + sex2 + height + weight + bmp + fev1 + rv + frc + tlc, data = cystfibr))
##
## Call:
## lm(formula = pemax ~ age + sex2 + height + weight + bmp + fev1 +
## rv + frc + tlc, data = cystfibr)
##
## Residuals:
## Min 1Q Median 3Q Max
## -37.34 -11.53 1.08 13.39 33.41
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 174.190 222.742 0.78 0.45
## age -2.542 4.802 -0.53 0.60
## sex2 -1.868 7.730 -0.24 0.81
## height -0.446 0.903 -0.49 0.63
## weight 2.993 2.008 1.49 0.16
## bmp -1.745 1.155 -1.51 0.15
## fev1 1.081 1.081 1.00 0.33
## rv 0.197 0.196 1.00 0.33
## frc -0.308 0.492 -0.63 0.54
## tlc 0.189 0.500 0.38 0.71
##
## Residual standard error: 25.5 on 15 degrees of freedom
## Multiple R-squared: 0.637, Adjusted R-squared: 0.42
## F-statistic: 2.93 on 9 and 15 DF, p-value: 0.032