Re: [R] User error in calling predict/model.frame

2011-01-30 Thread Russell Pierce
down to writing functions. Best, Russell S. Pierce, M.A. Visual Cognition Lab Department of Psychology University of California, Riverside 900 University Avenue Riverside, CA 92521 Lab Phone: (951) 827-7399 On Sat, Jan 29, 2011 at 9:12 AM, Russell Pierce wrote: > Just in case someone e

Re: [R] User error in calling predict/model.frame

2011-01-29 Thread Russell Pierce
David, Thanks for your feedback. However, I think if you look at the mean of your output (which, as a minor point, doesn't provide the same data to predict as expand.grid(X1=c(-1,0,1),X2=c(-1,0,1)), you'll see it is very different from the mean of dat$out. Like Ista's previous answer, I think in

Re: [R] User error in calling predict/model.frame

2011-01-29 Thread Russell Pierce
Just in case someone else stumbles onto this thread and is facing a similar issue:  The quick solution for me turned out to be using Glm and Predict in the rms package. Thanks go to Joshua and Ista for helping me out with this issue. Double thanks go to Joshua for suggesting I take a closer look

Re: [R] User error in calling predict/model.frame

2011-01-28 Thread Russell Pierce
the lm object newdata <- expand.grid(X1=c(-1,0,1),X2=c(-1,0,1)) #No need to rename newdata as it matches my lm object already newdata$Y <- predict(lm.res.correct,newdata) Notably, adjusting my formula to include as.vector() does not solve the problem w

Re: [R] User error in calling predict/model.frame

2011-01-28 Thread Russell Pierce
s that the names of the predictors in newdata do not > match the names of the predictors in dat. > > names(newdata) <- names(dat)[1:2] >newdata$Y <- predict(lm.obj,newdata) > > does work on my machine. > > Best, > Ista > > On Fri, Jan 28, 2011 at 4:37 PM

[R] User error in calling predict/model.frame

2011-01-28 Thread Russell Pierce
I want to predict values from an existing lm (linear model, e.g. lm.obj) result in R using a new set of predictor variables (e.g. newdata). However, it seems that because my linear models was made by calling scale() on the target predictor that predict exits with an error, "Error in scale(xxA, cen

Re: [R] Suprising behavior of paste or cat?

2010-02-11 Thread Russell Pierce
t; (Unicode), even > though R is writing ASCII? > > Duncan Murdoch > > On 11/02/2010 1:44 PM, Russell Pierce wrote: >> >> Thank you for your input so far r-help denizens.  Neither David nor >> Peter were able to replicate my result.  Has anybody other than me >

Re: [R] Suprising behavior of paste or cat?

2010-02-11 Thread Russell Pierce
quot;,res1.yes.lastcomma) #okay write(file="write-2-lc.txt",res2.yes.lastcomma) #okay cat(file="cat-1-lc.txt",res1.yes.lastcomma) #bad cat(file="cat-2-lc.txt",res2.yes.lastcomma) #bad Thanks, Russell On Thu, Feb 11, 2010 at 9:05 AM, William Dunlap wrote: > > &

Re: [R] Suprising behavior of paste or cat?

2010-02-11 Thread Russell Pierce
If the list would provide additional reports I'd appreciate it. I replicated the effect this morning on another Windows XP machine... R version 2.10.1 (2009-12-14) i386-pc-mingw32 locale: [1] LC_COLLATE=English_United States.1252 [2] LC_CTYPE=English_United States.1252 [3] LC_MONETARY=English_Uni

[R] Suprising behavior of paste or cat?

2010-02-10 Thread Russell Pierce
(x) {return(paste(x,",",collapse="",sep=""))} res <- lastcomma(taskout) write(file="fail.txt",res) cat(file="catfail.txt",res) Any ideas as to how to avoid this problem would be appriciated as well as suggestions as to whether this is expected beha

[R] Last working lme4?

2009-01-14 Thread Russell Pierce
This evening I ran into the problem Chuck Clifton referred to in message 86 of Volume 71 Issue 9 of this list. That is, objects created by lmer change after calling pvals.fnc on that lmer object when using lme4 version 0.999375-16 and 0.999375-28. This is somewhat troublesome. The bug tracker on

Re: [R] Odp: Unexpected Behavior (potentially) in t.test

2008-06-23 Thread Russell Pierce
s again for your time and effort, --- Russell Pierce Psychology Department Graduate Student - Cognitive (951) 827-2553 University of California, Riverside, 92521 > > > So you (Russell, not Petr) need to do some more work. You have the > problem, and you can do things like printing the d

[R] Unexpected Behavior (potentially) in t.test

2008-06-20 Thread Russell Pierce
quot;,sep=""),height=600,width=800,bg="white") # Create the image dev.off() #Save the image chi <- rbind(table(t1pvals <= .05),table(plainp <= .05)) #debugging chisq.test(chi) #debugging explore <- data.frame(t1=t1pvals,t2=t2pvals,picked=plainp) #debugging