Example 2.B.4 from Generalized Linear Mixed Models: Modern Concepts, Methods and Applications by Walter W. Stroup(p-56)
Source:R/Exam2.B.4.R
Exam2.B.4.Rd
Exam2.B.4 is used to illustrate one way treatment design with Binomial 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
#-----------------------------------------------------------------------------------
## logit Model discussed in Example 2.B.2 using DataExam2.B.4
## Default link is logit
## using fmaily=binomial gives warning message of no-integer successes
#-----------------------------------------------------------------------------------
data(DataExam2.B.4)
DataExam2.B.4$trt <- factor(x = DataExam2.B.4$trt)
Exam2.B.4glm <-
glm(
formula = Yij/Nij ~ trt
, family = quasibinomial(link = "probit")
, data = DataExam2.B.4
)
summary(Exam2.B.4glm)
#>
#> Call:
#> glm(formula = Yij/Nij ~ trt, family = quasibinomial(link = "probit"),
#> data = DataExam2.B.4)
#>
#> Coefficients:
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) -0.7729 0.3737 -2.068 0.130
#> trt2 0.7729 0.5017 1.541 0.221
#> trt3 0.9408 0.5029 1.871 0.158
#>
#> (Dispersion parameter for quasibinomial family taken to be 0.1426701)
#>
#> Null deviance: 1.01671 on 5 degrees of freedom
#> Residual deviance: 0.43701 on 3 degrees of freedom
#> AIC: NA
#>
#> Number of Fisher Scoring iterations: 4
#>
library(parameters)
model_parameters(Exam2.B.4glm)
#> Parameter | Log-Risk | SE | 95% CI | t(3) | p
#> --------------------------------------------------------------
#> (Intercept) | -0.77 | 0.37 | [-1.55, -0.07] | -2.07 | 0.039
#> trt [2] | 0.77 | 0.50 | [-0.19, 1.78] | 1.54 | 0.123
#> trt [3] | 0.94 | 0.50 | [-0.03, 1.95] | 1.87 | 0.061
#>
#> Uncertainty intervals (profile-likelihood) and p-values (two-tailed)
#> computed using a Wald t-distribution approximation.