School administrators study the attendance behavior of high school juniors at two schools.

data("Attendance")

Format

Data frame containing 314 observations on 4 variables.

daysabs

number of days absent.

gender

gender of the student.

prog

three-level factor indicating the type of instructional program in which the student is enrolled.

math

standardized math score.

Source

Data can be obtained from Introduction to Statistical Modeling Github Repository. See also Barreto-Souza and Simas (2020) for further details.

Details

School administrators study the attendance behavior of high school juniors at two schools. Predictors of the number of days of absence include the type of program in which the student is enrolled and a standardized test in math. Attendance data on 314 high school juniors from two urban high schools. The response variable of interest is days absent, daysabs. The variable math is the standardized math score for each student. The variable prog is a three-level factor indicating the type of instructional program in which the student is enrolled.

References

Hughes, M. and Fisher, T. (2020) Introduction to Statistical Modeling.

Examples

# \donttest{ data("Attendance", package = "mixpoissonreg") daysabs_fit <- mixpoissonreg(daysabs ~ gender + math + prog | gender + math + prog, data = Attendance, model = "PIG") summary(daysabs_fit)
#> #> Poisson Inverse Gaussian Regression - Expectation-Maximization Algorithm #> #> Call: #> mixpoissonreg(formula = daysabs ~ gender + math + prog | gender + #> math + prog, data = Attendance, model = "PIG") #> #> #> Pearson residuals: #> RSS Min 1Q Median 3Q Max #> 239.2040 -1.0836 -0.6058 -0.3062 0.2519 4.1196 #> #> Coefficients modeling the mean (with link): #> Estimate Std.error z-value Pr(>|z|) #> (Intercept) 2.750853 0.165416 16.630 < 2e-16 *** #> gendermale -0.251161 0.136873 -1.835 0.06651 . #> math -0.006730 0.002679 -2.512 0.01202 * #> progAcademic -0.423484 0.148479 -2.852 0.00434 ** #> progVocational -1.260924 0.203436 -6.198 5.71e-10 *** #> #> Coefficients modeling the precision (with link): #> Estimate Std.error z-value Pr(>|z|) #> (Intercept) 1.211252 0.438442 2.763 0.005734 ** #> gendermale -0.114332 0.304682 -0.375 0.707475 #> math -0.005686 0.006098 -0.932 0.351111 #> progAcademic -1.284018 0.386350 -3.323 0.000889 *** #> progVocational -1.610037 0.475613 -3.385 0.000711 *** #> --- #> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 #> #> Efron's pseudo R-squared: 0.1861608 #> Number of iterations of the EM algorithm = 2632
daysabs_fit_red <- mixpoissonreg(daysabs ~ gender + math + prog | prog, data = Attendance, model = "PIG") summary(daysabs_fit_red)
#> #> Poisson Inverse Gaussian Regression - Expectation-Maximization Algorithm #> #> Call: #> mixpoissonreg(formula = daysabs ~ gender + math + prog | prog, #> data = Attendance, model = "PIG") #> #> #> Pearson residuals: #> RSS Min 1Q Median 3Q Max #> 239.2879 -1.0042 -0.6101 -0.3107 0.2734 4.2814 #> #> Coefficients modeling the mean (with link): #> Estimate Std.error z-value Pr(>|z|) #> (Intercept) 2.805150 0.162182 17.296 < 2e-16 *** #> gendermale -0.282333 0.122772 -2.300 0.02147 * #> math -0.007770 0.002398 -3.240 0.00120 ** #> progAcademic -0.422885 0.148013 -2.857 0.00428 ** #> progVocational -1.215877 0.197264 -6.164 7.11e-10 *** #> #> Coefficients modeling the precision (with link): #> Estimate Std.error z-value Pr(>|z|) #> (Intercept) 0.9277 0.3308 2.805 0.005039 ** #> progAcademic -1.2799 0.3853 -3.322 0.000894 *** #> progVocational -1.7440 0.4506 -3.870 0.000109 *** #> --- #> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 #> #> Efron's pseudo R-squared: 0.1858037 #> Number of iterations of the EM algorithm = 19
# Plot of the fit with all precision covariates plot(daysabs_fit)
local_influence_plot(daysabs_fit)
# Plot, using ggplot2, of the reduced fit autoplot(daysabs_fit_red)
local_influence_autoplot(daysabs_fit_red)
# }