Hello there, I am presently using the locfit package in "R" and would appreciate some help here. Could anyone tell me tell me how I can obtain the various components (x and y values)of the density estimation after using the "R" command "locfit"? For example, with the command "fhat<-density(somename)" I can obtain the x and y values by simply calling "fhat$x" and "fhat$y". This doesn't seems to work with the "locfit" command. Thank you in advance. Regards, Kwabena -------------------------------------------- Kwabena Adusei-Poku University of Goettingen Institute of Statistics and Econometrics Platz der Goettingen Sieben 5 37073 Goettingen Germany Tel: +49-(0)551-394794
Kwabena Adusei-Poku wrote:> Hello there, > > I am presently using the locfit package in "R" and would appreciate some > help here. Could anyone tell me tell me how I can obtain the various > components (x and y values)of the density estimation after using the "R" > command "locfit"? For example, with the command > "fhat<-density(somename)" I can obtain the x and y values by simply > calling "fhat$x" and "fhat$y". This doesn't seems to work with the > "locfit" command. > > Thank you in advance. > > Regards, > > KwabenaOn the ?locfit help page it says: An object with class '"locfit"'. A standard set of methods for printing, ploting, etc. these objects is provided. This implies that there should be a fitted.locfit method. And, indeed, there is: data(ethanol) x <- ethanol$E fit <- locfit(~ x) plot(x[order(x)], fitted(fit)[order(x)], type = "n") HTH, --sundar
Maybe Matching Threads
- Kolmogorov-Smirnof test for lognormal distribution with estimated parameters
- How to translate the 2D-density matrix (the output of bkde2D function) into matrix of datapoints' amounts?
- Kernel density estimate plot for 3-dimensional data
- overlaid filled contour plots
- How to get the datapoints of an density estimationwithlocfit?