[R] fitted values with locfit

Peter Ehlers ehlers at ucalgary.ca
Mon Mar 19 22:38:32 CET 2012


On 2012-03-19 02:12, Soberon Velez, Alexandra Pilar wrote:
> Dear memberships,
>
>
>
> I'm trying to estimate the following multivariate local regression model using the "locfit" package:
>
> BMI=m1(RCC)+m2(WCC)
>
> where (m1) and (m2) are unknown smooth functions.
>
>
> My problem is that once I get the regression done I cannot get the fitted values of each of this smooth functions (m1) and (m2). What I write is the following
>
> library(locfit)
>
> data(ais)
> fit2<-locfit.raw(x=lp(ais$RCC,h=0.5,deg=1)+lp(ais$WCC,deg=1,h=0.75),y=ais$BMI,ev=dat(),kt="prod",kern="gauss")
> g21<-predict(fit2,type="terms")
>
>
> If I done this on the computer the results of (g21) is a vector when I should have a matrix with 2 columns (one for each fitted smooth function).
>

?predict.locfit doesn't indicate the option of a 'terms' argument.
Also, your model specification doesn't look correct: either provide
a formula to locfit() or a matrix x to locfit.raw.

Peter Ehlers

>
> Please, somebody knows how can I get the estimated fitted values of both smooth functions (m1) and (m2) using a local linear regression with kernel weights as this example?
>
>
> thanks a lot in advance I'm very desperate.
>
> Alexandra
>
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list