There's more...

The predict.spm function can be used to score new observations. It’s also worth noting that we can effectively control the degree of smoothing that we want for the nonparametric part by using the spar= parameter, or alternatively by specifying the degrees of freedom using the df= parameter, as shown in the following example:

fit <- spm(data_sim$y ~ data_sim$x1 + f(data_sim$x2,spar=20))  
summary(fit)
plot(fit)
fit <- spm(data_sim$y ~ data_sim$x1 + f(data_sim$x2,df=6))
summary(fit)
plot(fit)
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.234.150