Q9.4
(a)
GROWTH=read.table(file.choose(),header=TRUE)
plot(GROWTH$HOURS,GROWTH$CELLS)
out=lm(formula=CELLS~HOURS+pmax(HOURS-70,0),data=GROWTH)
# alternatively, out=lm(formula=CELLS~HOURS*(HOURS>70),data=GROWTH)
{ Alternatively, we can fit E(y)=beta0+beta1X1+beta2(X1-70)X2+beta3X2) }
{ If fit E(y)=beta0+beta1X1+beta2(X1-70)X2+beta3X2),
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept)
1.03284
1.28572
0.803
0.436
HOURS
0.17726
0.03209
5.523 9.82e-05 ***
HOURS > 70TRUE
28.86002
5.00779
5.763 6.57e-05 ***
HOURS:HOURS > 70TRUE -0.31654
0.05389 -5.874 5.46e-05 ***
the regression equation is E(Y)=1.033+.177X1+28.86X2-.317X1X2
that is we have E(y)=1.033+.177X1-.317 (X1-70)X2+99.177X2 .
The rest questions can be solved accordingly.
}
Q9.10
OJUICE=read.table(file.choose(),header=TRUE)
out=lm(formula=SweetIndex~Pectin,data=OJUICE)
summary(out)
anova(out)
lm(formula = SweetIndex ~ Pectin, data = OJUICE)
Residuals:
Min
1Q
-0.54373 -0.11039
Median
0.06089
3Q
0.13432
Max
0.34638
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 6.2520679 0.2366220 26.422
<2e-16 ***
Pectin
-0.0023106 0.0009049 -2.554
0.0181 *
--Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.215 on 22 degrees of freedom
Multiple R-squared: 0.2286, Adjusted R-squared: 0.1936
F-statistic: 6.52 on 1 and 22 DF, p-value: 0.01811
Analysis of Variance Table
Response: SweetIndex
Df Sum Sq Mean Sq F value Pr(>F)
Pectin
1 0.3014 0.301402 6.5204 0.01811 *
Residuals 22 1.0169 0.046224
--Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Q9.24
Q9.28
BONDING=read.table(file.choose(),header=TRUE)
out=glm(ADHESIVE~ARIScore,family="binomial",data=BONDING)
summary(out)
© Copyright 2025 Paperzz