Example 2.B.3 from Generalized Linear Mixed Models: Modern Concepts, Methods and Applications by Walter W. Stroup(p-55)
Source:R/Exam2.B.3.R
Exam2.B.3.Rd
Exam2.B.3 is used to illustrate one way treatment design with Gaussian observations.
References
Stroup, W. W. (2012). Generalized Linear Mixed Models: Modern Concepts, Methods and Applications. CRC Press.
Author
Muhammad Yaseen (myaseen208@gmail.com)
Adeela Munawar (adeela.uaf@gmail.com)
Examples
#-----------------------------------------------------------------------------------
## Means Model discussed in Example 2.B.3 using DataExam2.B.3
#-----------------------------------------------------------------------------------
Exam2.B.3.lm1 <- lm(formula = y ~ trt, data = DataExam2.B.3)
summary(Exam2.B.3.lm1)
#>
#> Call:
#> lm(formula = y ~ trt, data = DataExam2.B.3)
#>
#> Residuals:
#> 1 2 3 4 5 6
#> -0.325 -0.125 1.000 -0.100 -1.275 0.825
#>
#> Coefficients:
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) 17.7500 1.0013 17.727 5.95e-05 ***
#> trt 1.5750 0.4635 3.398 0.0273 *
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#>
#> Residual standard error: 0.927 on 4 degrees of freedom
#> Multiple R-squared: 0.7427, Adjusted R-squared: 0.6784
#> F-statistic: 11.55 on 1 and 4 DF, p-value: 0.02733
#>
#-----------------------------------------------------------------------------------
## Effectss Model discussed in Example 2.B.3 using DataExam2.B.3
#-----------------------------------------------------------------------------------
Exam2.B.3.lm2 <- lm(formula = y ~ 0 + trt, data = DataExam2.B.3)
summary(Exam2.B.3.lm2)
#>
#> Call:
#> lm(formula = y ~ 0 + trt, data = DataExam2.B.3)
#>
#> Residuals:
#> 1 2 3 4 5 6
#> 9.818 10.018 3.536 2.436 -6.346 -4.246
#>
#> Coefficients:
#> Estimate Std. Error t value Pr(>|t|)
#> trt 9.182 1.398 6.57 0.00123 **
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#>
#> Residual standard error: 7.396 on 5 degrees of freedom
#> Multiple R-squared: 0.8962, Adjusted R-squared: 0.8754
#> F-statistic: 43.16 on 1 and 5 DF, p-value: 0.001226
#>
library(parameters)
model_parameters(Exam2.B.3.lm2)
#> Parameter | Coefficient | SE | 95% CI | t(5) | p
#> -------------------------------------------------------------
#> trt | 9.18 | 1.40 | [5.59, 12.77] | 6.57 | 0.001
#>
#> Uncertainty intervals (equal-tailed) and p-values (two-tailed) computed
#> using a Wald t-distribution approximation.