Re: [R] Insert row in specific location between data frames

2012-07-02 Thread pigpigmeow
I have already follow your step, it still not work when I merge groupA and groupB , the error message was shown Error in rbind(deparse.level, ...) : replacement has length zero -- View this message in context: http://r.789695.n4.nabble.com/Insert-row-in-specific-location-between-data-frames-tp463

Re: [R] Insert row in specific location between data frames

2012-07-01 Thread pigpigmeow
First, I have "predict_SO2_a" which is contained 24 data. I want to insert "NA" in 11th row. Then, "predict_SO2_a" becomes 25 data. After insert the row, I want to use "with" function to combine the data.frame />groupA$predict_SO2<-with(groupA, predict_SO2_a). / />dput(predict_SO2_a) c(39.793230812

Re: [R] Insert row in specific location between data frames

2012-07-01 Thread pigpigmeow
i'm not success to insert row in specific location and merge another file I have a question and I feel confused about the usage of "rbind", "cbind" and "data.frame) data 1: > predict_SO2_a predict_SO2_a 1 39.793231 2 30.252578 3 32.467584 4 31.941509 5 27.908320

[R] About Error message

2012-06-29 Thread pigpigmeow
Hi again! I have a question about R. I have done gam in previous version of R with "mgcv" package and saved the workspace. This workspace contains different models and I will do prediction by these GAMs. However, I install new version of R. and use the same workspace. when I type summary(models),

[R] Insert row in specific location between data frames

2012-06-29 Thread pigpigmeow
Hi everyone! I have a simple question. my data is predict_SO2_a 1 39.793231 2 30.252578 3 32.467584 4 31.941509 5 27.908320 6 11.594137 79.368125 8 12.319093 9 11.558811 10 7.937192 11 11.211306 12 12.400342 13 12.39314

[R] How to calculate the predicted value by using GAMs?

2012-06-24 Thread pigpigmeow
I really want to know how to calculate the predicted valued when I use gam.predict . my model is: newSO2 ~ s(pressure, bs = "cr") + s(maxtemp, bs = "cr") + mintemp + RH + solar + s(windspeed, bs = "cr") + s(transport, bs = "cr") > my new dataset is : pressure: -7.056847826 maxtemp: 2.737507

Re: [R] please help! Extract the row to the new file by using if-statment

2012-06-01 Thread pigpigmeow
Thank, it OK now but I don't understand what is the meaning of y <- y[!is.na(y[5]),] Thank in advance! -- View this message in context: http://r.789695.n4.nabble.com/please-help-Extract-the-row-to-the-new-file-by-using-if-statment-tp4631957p4632090.html Sent from the R help mailing list archive

[R] Adding a column into the file

2012-06-01 Thread pigpigmeow
Dear all, I have a lot of problems on R-programming. for example my csv. file is .. Date wrfRH wrfsolar wrfwindspeed wrfrain wrftd wrfta 21/10/2010 92.97 22.11 53.27 0 1546.337861 61.00852664 22/10/2010 87.35 21.99 40.89 0 1300.408288 62.85352227 23/10/2010 88.38 21.71 28.04 0.01 1

[R] please help! Extract the row to the new file by using if-statment

2012-05-31 Thread pigpigmeow
Dear all, I find some troubles about how to extact the row from csv. file by using if-statement condition. I want to extract the row if the rainfall is greater than the mean of rainfall and using the wrfta divided into 3 groups that's rainfall greater than mean -> group A ( create file group A_rai

Re: [R] Question about GAMs

2011-10-13 Thread pigpigmeow
pre<-predict(ozonea,groupA,type="terms",terms=NULL,newdata.guaranteed=FALSE,na.action=na.pass) yeah! but I don't know how to only show the value of s(ratio,bs="cr") -- View this message in context: http://r.789695.n4.nabble.com/Question-about-GAMs-tp3900848p3903753.html Sent from the R help mail

Re: [R] Question about GAMs

2011-10-13 Thread pigpigmeow
I'm confused... I type .. predict.gam(ozonea,type=s(ratio,bs="cr")) pressure maxtemp s(avetemp) s(ratio) 1 -0.0459102290 -0.185178463 0.263358446 -0.164558673 2 -0.0286464652 -0.194731320 0.199315027 0.727823293 30.0478073459 -0.013227033 0.002228896 0.342373202 4 -0.00

[R] Question about GAMs

2011-10-13 Thread pigpigmeow
hi! I hope all of you can help me this question for example GAMs: ozonea<-gam(newozone~ pressure+maxtemp+s(avetemp,bs="cr")+s(ratio,bs="cr"),family=gaussian (link=log),groupA,methods=REML) formula(ozonea) newozone ~ pressure + maxtemp + s(avetemp, bs = "cr") + s(ratio,bs = "cr") #formula of gam

Re: [R] plot probability density function (pdf)

2011-10-12 Thread pigpigmeow
thank you all of u -- View this message in context: http://r.789695.n4.nabble.com/plot-probability-density-function-pdf-tp3897055p3900396.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.et

Re: [R] plot probability density function (pdf)

2011-10-12 Thread pigpigmeow
x11() what does it mean? if my data has missing value, can I plot the graph? -- View this message in context: http://r.789695.n4.nabble.com/plot-probability-density-function-pdf-tp3897055p3898362.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] plot probability density function (pdf)

2011-10-12 Thread pigpigmeow
i want to plot probability density function,predictvalue has missing value and observevalue has not missing value, I tried .. attach(test) #test is the name of the data file names(test) plot(density(predictvalue,na.rm=TRUE)) lines(density(observevalue)) is it correct? -- View this message in c

Re: [R] plot probability density function (pdf)

2011-10-12 Thread pigpigmeow
however, if i have an excel file, but there have 6 variables, a,b,c,d,e,f. how to plot the probability density function of a and d in one graph, b and e in another graph? -- View this message in context: http://r.789695.n4.nabble.com/plot-probability-density-function-pdf-tp3897055p3898183.html

[R] plot probability density function (pdf)

2011-10-12 Thread pigpigmeow
I have 2 series of variables, I want to plot the probability density function of these 2 variabels (i.e. two curves in one graph), I just want to compare these two variable distribution. what should I do? can I use ggplot2 package? -- View this message in context: http://r.789695.n4.nabble.com/pl

Re: [R] About stepwise regression problem

2011-10-06 Thread pigpigmeow
chris, I'm not using lmer, i just use gam mixed with smoothing function and linear function and summary of the model, it shows Family: gaussian Link function: log Formula: newNO2 ~ pressure + s(maxtemp, bs = "cr") + s(avetemp, bs = "cr") + s(mintemp, bs = "cr") + RH + s(solar, bs = "cr") +

Re: [R] About stepwise regression problem

2011-10-06 Thread pigpigmeow
using AIC/BIC, I'm not know too much about this. I just know using p-value to perform stepwise regression if I used p-value to perform multimodel stepwise regression, is it correct in the first message box? -- View this message in context: http://r.789695.n4.nabble.com/About-stepwise-regression-

Re: [R] About stepwise regression problem

2011-10-06 Thread pigpigmeow
If I used mixed model ( linear + smoothing function) How can I used p-value to perform stepwise regression??? Is it similar of Pr(<|t|) of linear term and P-value of smoothing term but T value of linear and F of smoothing term? please help! -- View this message in context: http://r.789695.n4.

[R] About stepwise regression problem

2011-10-04 Thread pigpigmeow
First of all, I have GAMs noxd<-gam(newNOX~pressure+maxtemp+s(avetemp,bs="cr")+s(mintemp,bs="cr")+s(RH,bs="cr")+s(solar,bs="cr")+s(windspeed,bs="cr")+s(transport,bs="cr"),family=gaussian (link=log),groupD,methods=REML) Then I type " summary(noxd)". and show Family: gaussian Link function: log

Re: [R] GAMs in R : How to put the new data into the model?

2011-09-28 Thread pigpigmeow
For example: GAMs and after stepwise regression: cod<-gam(newCO~RH+s(solar,bs="cr")+windspeed+s(transport,bs="cr"),family=gaussian (link=log),groupD,methods=REML) I used 10 year meterorology data (2000-2010) to form equation of concentration of carbon monoxide. NOW, I have 2011 meteorology data,

[R] GAMs in R : How to put the new data into the model?

2011-09-27 Thread pigpigmeow
I have 5 GAMs ( model1, model2, model3, model4 and model5) Before I use some data X(predictor -January to June data) to form a equation and calculate the expected value of Y (predictand -January to June). After variable selection, GAMs (Model 1)were bulit up! R-square :0.40 NOW, I want to use new

[R] log-link function problem

2011-06-25 Thread pigpigmeow
y<-gam(a~s(b),family=gaussian(link=log),data) y<-gam(loga~s(b), family =gaussian (link=identity),data) y<-gam(loga~s(b),family=gaussian(link=log),data) what are the diffent these 3 equations? -- View this message in context: http://r.789695.n4.nabble.com/log-link-function-problem-tp3625014p3625

[R] about partial response and partial residual

2011-06-25 Thread pigpigmeow
i use "mgcv" package First, what is the different between partial response and partial residual plot? actually, is it partial response is as same as partial regression? second, if I use "log-link fuction", how to plot partial response and partial residual plot by R? Finally, If I want to plot p

Re: [R] please help for mgcv package

2011-06-21 Thread pigpigmeow
b<-rep(0,n-11) for(i in 0:(11-10)) b<-b+a[(i+1):(n-11+i)] i don't know what does "rep" mean and for-loop! -- View this message in context: http://r.789695.n4.nabble.com/please-help-for-mgcv-package-tp3614485p3615861.html Sent from the R help mailing list archive at Nabble.com. __

[R] please help for mgcv package

2011-06-21 Thread pigpigmeow
i read a book from WOOD, there's an example which is talking about the pollutant. library(gamair) library(mgcv) y<-gam(death~s(time,bs="cr",k=200)+s(pm10median,bs="cr")+s(so2median,bs="cr")+s(o3median,bs="cr")+s(tmpd,bs="cr"),data=chicago,family=Possion) lag.sum<-function(a,10,11) {n<-length(a) b

Re: [R] please help for mgcv package

2011-06-21 Thread pigpigmeow
it is from Generalized Additive Models an introduction with R by Simon N.Wood . Page 251 -- View this message in context: http://r.789695.n4.nabble.com/please-help-for-mgcv-package-tp3614485p3614535.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] About GAM in R, Need YOUR HELP!

2011-06-20 Thread pigpigmeow
Actually, I 'm using "mgcv" package. But I learnt basic linear regression in my school, it is really hard for me to handle these problem! by the way, i need to work harder! -- View this message in context: http://r.789695.n4.nabble.com/About-GAM-in-R-Need-YOUR-HELP-tp3610522p3611796.html Sent f

[R] About GAM in R, Need YOUR HELP!

2011-06-20 Thread pigpigmeow
I'm beginner in R! I have a lot of problems on R. I have three questions about GAM 1. What is the function of Gaussian distribution in GAM?(if I choose family is Gaussian) Is it used in the predictand value (Y)? 2. How to plot a graph the gam function? For example: y<-gam(a~s(b),family=gauss

[R] please help! what are the different using log-link function and log transformation?

2011-06-19 Thread pigpigmeow
I'm new R-programming user, I need to use gam function. y<-gam(a~s(b),family=gaussian(link=log),data) y<-gam(loga~s(b), family =gaussian (link=identity),data) why these two command results are different? I guess these two command results are same, but actally these two command results are differen