Andrew Crane-Droesch
2012-Oct-06 02:07 UTC
[R] SPM/SemiPar -- Plotting additive interactions
I'm taking the residual-regression approach to semiparametric estimation (Robinson 1988, Econometrica), and basically using SemiPar simply as a convenient means of doing multivariate nonparamteric additive models. The final bit of code is here: finalfit <- spm(res~f(V3,basis="trunc.poly")+f(V5,basis="trunc.poly")+f(V6,basis="trunc.poly")) summary(finalfit) par(mfrow = c(2,2)) plot(finalfit) you can see the plot here: http://i.imgur.com/qaPc8.png V3 is a main effect, V5 and V6 are interactions between dummy variables and V3. What I want to do is somehow combine V3 and V5, and V3 and V6. Put differently, V5 shows the additive effect of the dummy variable to V3 when the dummy equals 1. So V3+V5 shows the effect of interest when the dummy equals 1. I would first need to extract the fitted values for each plot, then simply add them, then add the confidence bands (according to rules for adding gaussians). How would I begin to do this based on the objects that semipar gives me, then how would I plot them? I'm new to R, so I appreciate any help. Thanks, Andrew