# Exam5.1: Example 5.1 from Generalized Linear Mixed Models: Modern... In StroupGLMM: R Codes and Datasets for Generalized Linear Mixed Models: Modern Concepts, Methods and Applications by Walter W. Stroup

## Description

Exam5.1 is used to show polynomial multiple regression with binomial response

## Author(s)

1. Muhammad Yaseen (myaseen208@gmail.com)

## References

1. Stroup, W. W. (2012). Generalized Linear Mixed Models: Modern Concepts, Methods and Applications. CRC Press.

`DataSet5.1`
 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125``` ```##---Sequential Fit of the logit Model Exam5.1.glm.1 <- glm( formula = F/N~ X , family = quasibinomial(link = "logit") , data = DataSet5.1 , weights = NULL # , subset # , na.action , start = NULL # , etastart # , mustart # , offset # , control = list(...) # , model = TRUE , method = "glm.fit" # , x = FALSE # , y = TRUE , contrasts = NULL # , ... ) summary(Exam5.1.glm.1) ## confint.default() produce Wald Confidence interval as SAS produces ##---Likelihood Ratio test for Model 1 (LRExam5.1.glm.1 <- anova( object = Exam5.1.glm.1 , test = "Chisq") ) library(aod) WaldExam5.1.glm.1 <- wald.test( Sigma = vcov(object=Exam5.1.glm.1) , b = coef(object=Exam5.1.glm.1) , Terms = 2 , L = NULL , H0 = NULL , df = NULL , verbose = FALSE ) ##---Sequential Fit of the logit Model quadratic terms involved Exam5.1.glm.2 <- glm( formula = F/N~ X + I(X^2) , family = quasibinomial(link = "logit") , data = DataSet5.1 , weights = NULL # , subset # , na.action , start = NULL # , etastart # , mustart # , offset # , control = list(...) # , model = TRUE , method = "glm.fit" # , x = FALSE # , y = TRUE , contrasts = NULL # , ... ) summary( Exam5.1.glm.2 ) ##---Likelihood Ratio test for Model Exam5.1.glm.2 (LRExam5.1.glm.2 <- anova( object = Exam5.1.glm.2 , test = "Chisq") ) WaldExam5.1.glm.2 <- wald.test( Sigma = vcov(object=Exam5.1.glm.2) , b = coef(object=Exam5.1.glm.2) , Terms = 3 , L = NULL , H0 = NULL , df = NULL , verbose = FALSE ) ##---Sequential Fit of the logit Model 5th power terms involved Exam5.1.glm.3 <- glm( formula = F/N~ X + I(X^2) + I(X^3) + I(X^4) + I(X^5) , family = quasibinomial(link = "logit") , data = DataSet5.1 , weights = NULL # , subset # , na.action , start = NULL # , etastart # , mustart # , offset # , control = list(...) # , model = TRUE , method = "glm.fit" # , x = FALSE # , y = TRUE , contrasts = NULL # , ... ) summary(Exam5.1.glm.3) ## confint.default() produce Wald Confidence interval as SAS produces ##---Likelihood Ratio test for Model 1 (LRExam5.1.glm.3 <- anova( object = Exam5.1.glm.3 , test = "Chisq") ) WaldExam5.1.glm.3 <- wald.test( Sigma = vcov(object=Exam5.1.glm.3) , b = coef(object=Exam5.1.glm.3) , Terms = 6 , L = NULL , H0 = NULL , df = NULL , verbose = FALSE ) ```