[R] Pspline program

Ernest GRAND egm@gnum @end|ng |rom y@hoo@|r
Wed Sep 11 23:00:32 CEST 2019


Hi,
I would like help from knowledgeble mai-listers in pspline matter.I just a beginner.
I have the following pspline program and I get strange (for me) results like :17.172881859251717.17297751018117.173073161111917.173168812047817.173264462992617.1733601139499for all file.
The file have 20234 data and keep 20234 data after processing by pspline.

library(sm)
library(pspline)
#Importing the dataset and converting into a matrix form#hist.df <- read.table('b1_27.txt', header=FALSE,col.names=c("A"), dec=".")
hist.df <- read.table("C:\\Users\\.....\\Desktop\\Pspline\\b1_27.txt", header=FALSE,col.names=c("A"), dec=".")
data <- as.matrix(hist.df$A,ncol=1)
#Getting a non-decreasing predictor variablex = c(1:20234)
#Fitting the pspline function, note that it will be a normal smoothing with order=2 and df = 4, method = 2 means degrees = df
res = smooth.Pspline(x,data,norder = 2,df=4,method=2)res
#Plotting the normal plot for the fitted values
sm.density(res$ysmth,model="normal")
setwd("C:\\Users\\....\\Desktop\\Pspline")
#writing the output into a tablewrite.table(res$ysmth, file = "b1_27_psp.txt", col.names = F,quote=F,row.names=F)
Thank you for your help.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: b1_27.txt
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20190911/f3891148/attachment.txt>


More information about the R-help mailing list