[R] using correlation compound correlation structure with nlme; how to incorporate multple random effects?

2013-09-06 Thread Meredith, Christy S -FS
no precip interaction I get the error message "non-numeric argument to mathematical function Thanks for any help. Christy Meredith This electronic message contains information generated by the USDA solely for the intended recipients. Any unauthorized interception of this message or th

Re: [R] help with for loop: new column giving count of observation for each SITEID

2012-11-01 Thread Meredith, Christy S -FS
fix this? Thanks Christy #Code for new column nth time sampled indexg=read.csv("indexg.csv") indexg=data.frame(indexg) indexi<-indexg[order(indexg$SiteID,indexg$Yr),] res<-do.call(rbind,lapply(split(indexi,indexi$SiteID),function(x) data.frame(x,newindex=1:nrow(x

Re: [R] help with for loop: new column giving count of observation for each SITEID

2012-10-30 Thread Meredith, Christy S -FS
, Christy S -FS; r-help@R-project.org Subject: RE: [R] help with for loop: new column giving count of observation for each SITEID Is this what you want? > withinGroupIndex <- function(group, ...) ave(integer(length(group)), group, ..., FUN=seq_along) > site <- c("A",

[R] help with for loop: new column giving count of observation for each SITEID

2012-10-30 Thread Meredith, Christy S -FS
;-indexg[order(indexg$SiteID,indexg$Yr),] obs=0 indexi=na.omit(indexi) for(i in 1:length(indexi$SiteID)){ obs=obs+1 indexi$obs[i]=obs } Thanks for any help you can give. Christy Meredith USDA Forest Service Rocky Mountain Research Station PIBO Monitoring Data Analyst Voice: 435-755-3573 Fax: 435

[R] randomly select another observation with same grouping factor and year value, do for every record in dataframe

2012-10-24 Thread Meredith, Christy S -FS
n as the first observation. I want the function to produce a list of the RchID of the first observation, the RchID of the second randomly chosen observation, and several other characteristics of the randomly chosen observation. Below is the code I have written, but it doesn't

Re: [R] how to create a new data given a vector of variable names

2012-05-14 Thread christy
oh, thank you very much! From: Michael Weylandt [via R] To: christy Sent: Tuesday, May 15, 2012 12:28 AM Subject: Re: how to create a new data given a vector of variable names I think you're making this too hard: x[, vars] should do it. For a sm

[R] how to create a new data given a vector of variable names

2012-05-14 Thread christy
5297375 0.629731365 0.130089829 0.29593089 [18,] 0.47563923 0.770202648 0.539668426 0.02915505 [19,] 0.60684813 0.810165262 0.776488706 0.27369892 [20,] 0.28905422 0.239598362 0.992742685 0.31494866 I tried to do the following but it does not give me what I want: x[names(x)==names(x[names(x)%in%vars])]

[R] problem with glsm.krige: trendd and trend l must have similar specifications error

2011-10-28 Thread Christy Meredith
Hello, I used glsm.mcmc and likfit.glsm to create model. Now I want to predict at different locations, but I can't get glsm.krige to work. I keep getting the error that trend.d and trend.l must have similar specifications. I have tried numerous ways to include the covariates in the glsm.krige

[R] releveling a numeric by factor interaction

2010-08-03 Thread Christy Denckla
e first used 2: In numeric:dummy : numerical expression has 152 elements: only the first used If relevel is only for factors, how can I perform an analogous procedure for factor by numeric interactions? Thank you in advance for advice, Christy Adelphi University Doctoral Candida

[R] releveling a numeric by factor interaction in a lm

2010-08-03 Thread Christy Denckla
How can I relevel a liner model with a numeric by dummy variable interaction to extract the model estimate, std. error, and t-value for the reference factor? Thank you, Christy [[alternative HTML version deleted]] __ R-help@r-project.org