[R] Interpretation of Coefficients of GAM

John Liu thatsmile333 at hotmail.com
Thu Mar 17 00:07:03 CET 2016


Hi all, 
May I have a  question on how to interpret the coefficients from GAM. 

 

We used  GAM to get propensity scores,  fitting model as below, 

fit  <- gam(group~agegroup+s(GA_Enr)+race+edugroup,
data = datax, family='binomial')

where ‘group’ is a binary variable for treatment(y/n)

‘agegroup’, ‘race’,  ‘edugroup’  are categorical
variables for age, race, and education years respectively. 

‘GA_Enr’ is a continuous variable for age at enrollment.
 We added smoothing term to it. 

 

And we  got the propensity scores as below, 

ps <- predict (fit, data = datax) 

 

Next we tried to manually calculate Pscores using the
coefficients from GAM. Our purpose was to compare the ps we manually calculated with the
ps  we obtained from the above line. They are supposed to be the same. 

 

Both coef(fit) and fit$smooth show coefficients from GAM.
  

Now for ‘GA_Enr’, we have one ‘general coefficient’ 
from coef(fit) , here call it coeff1.

And still for ‘GA_Enr’, from fit$smooth, we have
‘coefficients for each subject’, here call it coeff2. 

 

My question is how to interpret coeff1 and coeff2 and how to
use them to calculate ps for each subject?

 

Thank you so much in advance!
Jen 		 	   		  
	[[alternative HTML version deleted]]



More information about the R-help mailing list