I'm trying to do a generalized additive model (GAM) with a spline in stata. I usually do it in R and the code is:
gam <- gam(winner ~ age + prev_experience + female + s(testscore), family = binomial, data)
I'm trying to do this code in stata using the gam command. I have:
gam winner age prev_experience female testscore, family = binomial
but if I don't specify the df it says the model is linear and does a normal logit regression, I don't want to specify the df the model is supposed to estimate it. Also how do I specify the spline for testscore, in R it's s(testscore) but there doesn't seem to be an equivalent option in the gam syntax for stata. Any suggestions??
gam <- gam(winner ~ age + prev_experience + female + s(testscore), family = binomial, data)
I'm trying to do this code in stata using the gam command. I have:
gam winner age prev_experience female testscore, family = binomial
but if I don't specify the df it says the model is linear and does a normal logit regression, I don't want to specify the df the model is supposed to estimate it. Also how do I specify the spline for testscore, in R it's s(testscore) but there doesn't seem to be an equivalent option in the gam syntax for stata. Any suggestions??
Comment