Displaying 1 result from an estimated 1 matches for "age_male".
2010 Aug 30
1
'mgcv' package, problem with predicting binomial (logit) data
...st.pred$fit[I1] , type="l")
I a second step, I want to calculate a similar model, but only for
respondents with a certain characteristic. For example, in this case, only
for male respondents.
I use a code that looks like this:
participant_male <- participant[gender=="male"]
age_male <- age[gender=="male"]
test2<-gam(participant_male ~ s(age_male, fx=FALSE, bs="cr"),
family=binomial(logit), na.action=na.omit)
summary(test2)
plot(test2, shade=TRUE)
I get a nice smoother function in this plot, like I expected.
Then, when I want to plot the predicted va...