Question
The question is like this: Fit a binomial regression model to these data with Deaths as the response and Indigenous (a factor) and Year as
The question is like this: Fit a binomial regression model to these data with Deaths as the
response and Indigenous (a factor) and Year as predictors.
I write codes in r:
custody<- read.table(file.choose(),header = TRUE)
custody$Indigenous<-factor(custody$Indigenous)
fit.glm<-glm(Deaths~Year+Indigenous,data=custody,family="binomial")
And the error says y should be 0<= y<=1, so could you help me to correct my codes, please?
Data here:
YearIndigenousPrisonersDeathsPopulation
1990Yes20416168317
1991Yes21668172462
1992Yes22232176827
1993Yes24167181341
1994Yes274211185836
1995Yes290717190438
1990No122642713141817
1991No128553113326044
1992No133363413501987
1993No134504213649262
1994No143024213810095
1995No145014213995940
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started