DS4PS / cpp-525-sum-2021

Course shell for CPP 525 Advanced Regression Analysis
http://ds4ps.org/cpp-525-sum-2021/
0 stars 2 forks source link

Lab 6 Q3a #10

Open DMBurwell opened 3 years ago

DMBurwell commented 3 years ago

Hi! I am getting an error message when running the probability formula for Q3c.

Error in $<-.data.frame(*tmp*, AdoptionP, value = c(1 = 0.355317313242931, : replacement has 49 rows, data has 1

I also can't run the code without the data$ in front of Evangelic within the mean command. This is less of an issue as it is just annoying...

Error in mean(Evangelic) : object 'Evangelic' not found

data2 <- with(data, data.frame(Adoption = 1, Democrats = mean(Democrats), Evangelic = mean(data$Evangelic), Catholics = mean(Catholics), Media = mean(Media), Merck = mean(Merck)))

data2$AdoptionP <- predict(log, newdata = data2, type = "response")

data2$AdoptionP

Thanks for the help!

ayildiz84 commented 3 years ago

Hi,

You are missing the "s" in Evangelic. If you try data$Evangelics, it will work.

lecy commented 3 years ago

https://github.com/DS4PS/cpp-525-fall-2020/issues/23#issuecomment-894934901