[R] lmer random effect model matrix question

2005-09-29 Thread Mark Lyman
I have one fixed effect, sor, with two levels. I have eight lots and three wafers from each lot. I have included the data below. I would like to fit a mixed model that estimates a covariance parameter for wafer, which is nested in lot, and two covariance parameters for lot, one for each level

[R] Bug in lmer?

2005-09-29 Thread Mark Lyman
I am relatively new to R so I am not confident enough in what I am doing to be certain this is a bug. I am running R 2.1.1 on a Windows XP machine and the lme4 package version 0.98-1. The following code fits the model I want using the nlme package version 3.1-60. mltloc$loc -

Re: [R] Bug in lmer?

2005-09-30 Thread Mark Lyman
I am using version 0.98-7 of the Matrix package. I used the RGui Install Packages... menu option to get the lme4 package from CRAN and this version of the Matrix was automatically downloaded as well. Martin Maechler wrote: Mark == Mark Lyman [EMAIL PROTECTED] on Thu, 29 Sep 2005 14:44:38

Re: [R] How to iteratively extract elements out of a list

2006-08-26 Thread Mark Lyman
lapply(m,function(x)x[x2]) [[1]] [1] 3 4 [[2]] [1] 4 5 [[3]] [1] 4 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide

Re: [R] Type II and III sum of square in Anova (R, car package)

2006-08-26 Thread Mark Lyman
the appropriate F-test. The danger with worrying about what type of sums of squares to use is that often we do not think about what hypotheses we are testing and if those hypotheses make sense in our situation. Mark Lyman __ R-help@stat.math.ethz.ch mailing list https

Re: [R] Help on apply() function

2006-08-29 Thread Mark Lyman
for identical. Mark Lyman __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible

[R] Incompatability of lme4 and Matrix packages

2006-10-09 Thread Mark Lyman
version. Mark Lyman __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Re: [R] How can I delete components in a column ?

2006-10-09 Thread Mark Lyman
ad cfh 4 bf cdt 5 empty 2 empty 2 gf cdh 4 d none 5 and want to eliminate all components that have id=none and empty . The remaining data should be Take a look at the subset function. Mark Lyman

Re: [R] Post Hoc Groupings

2005-10-26 Thread Mark Lyman
Looking at the errors your code produces, it looks like you need to make Dock and Slip factors. dock_2004_data$Dockf-factor(dock_2004_data$Dock) dock_2004_data$Slipf-factor(dock_2004_data$Slip) rich.aov - aov(X.open ~ Dockf*Slipf, data=dock_2004_data) TukeyHSD(rich.aov, c(Dockf, Slipf))

[R] Specify Z matrix with lmer function

2005-11-03 Thread Mark Lyman
Is there a way to specify a Z matrix using the lmer function, where the model is written as y = X*Beta + Z*u + e? I am trying to reproduce smoothing methods illustrated in the paper Smoothing with Mixed Model Software my Long Ngo and M.P. Wand. published in the /Journal of Statistical

Re: [R] write data to pdf

2006-10-19 Thread Mark Lyman
Franco Mendolia franco.mendolia at gmx.de writes: Hello! Is there a possibility in R to save data in pdf-format? I do not want to save a plot but some lines of simple text. Regards, Franco Mendolia You could also use pdf() and textplot() in the gplots package Mark Lyman

Re: [R] Plotmath expression

2006-10-24 Thread Mark Lyman
) plot(1:10) text(x=9, y=2, pos=2, expression(paste(X[min], =, paste(ll, collapse=+/- How about the following? text(x=9, y=2, pos=2,substitute(X[min]==x%+-%sde,as.list(ll))) Mark Lyman __ R-help@stat.math.ethz.ch mailing list https

Re: [R] update index in

2006-10-25 Thread Mark Lyman
: days-c(1:10)[-5:-7] xx-rnorm(7) data-data.frame(xx,days) new.data-merge(data,data.frame(days=1:10),all.y=TRUE) It usually is not a good idea to use zeroes as placeholders for missing values. Mark Lyman __ R-help@stat.math.ethz.ch mailing list

Re: [R] applying cor.test in two different but matched dataframes

2006-11-17 Thread Mark Lyman
(as.data.frame(t(x))) t.y-as.list(as.data.frame(t(y))) # Use mapply to apply function to the two lists; see ?mapply mapply(cor.test,t.x,t.y) Mark Lyman __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] Problem with fitted.value function

2006-11-17 Thread Mark Lyman
I don't know how to use the fitted values function with a given function and given input-variables but yet unknown result-values. Take a look at the predict function, ?predict. Mark Lyman __ R-help@stat.math.ethz.ch mailing list https

Re: [R] LM Model

2007-02-09 Thread Mark Lyman
? Or maybe somebody has another solution? Thanks in advance, Simon Here is one way. Take a look at help(offset), help(lm), and help(lm.predict). xx - runif(30) yy - rnorm(30) mydata-data.frame(xx,yy) lm(yy~offset(15*rep(1,30))+offset(-0.15*xx)-1,mydata) Mark Lyman

Re: [R] Using variable names in for loops - Generating plot s semi-automatically from a series of variables Partly solved

2007-02-09 Thread Mark Lyman
and other related functions, like substitute, but what I have been able figure out has been very useful. Mark Lyman __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

Re: [R] plotting derived values not raw

2007-02-09 Thread Mark Lyman
and standard error values. Is there a way to do this in R? Thanks for any help in advance. james I believe that xYplot in the Hmisc package will do what you want Mark Lyman __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo

Re: [R] sapply again return value

2007-02-16 Thread Mark Lyman
Antje niederlein-rstat at yahoo.de writes: Hello, I used an sapply to get some data back (s - sapply(...) ). The output of s would then deliver something like this: B06_lamp.csv C06_lamp.csv D06_lamp.csv [1,] NULL NULL Numeric,512 [2,] NULL NULL

Re: [R] barchart (lattice) with text labels

2007-02-25 Thread Mark Lyman
=as.character(signif(x[ok],2)), ...) } } Mark Lyman __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self

[R] Adding points to a wireframe with conditioning variable

2007-07-05 Thread Mark Lyman
I would like to add points to a wireframe but with a conditioning variable. I found a solution for this without a conditioning variable here, http://finzi.psych.upenn.edu/R/Rhelp02a/archive/65321.html. Does anyone know how to plot a wireframe conditioned on a variable and add the points

Re: [R] Adding points to a wireframe with conditioning variable

2007-07-05 Thread Mark Lyman
Deepayan Sarkar deepayan.sarkar at gmail.com writes: On 7/5/07, Mark Lyman mark.lyman at gmail.com wrote: I would like to add points to a wireframe but with a conditioning variable. I found a solution for this without a conditioning variable here, http://finzi.psych.upenn.edu/R/Rhelp02a

Re: [R] problems with character objects and calls to list()

2007-07-23 Thread Mark Lyman
Really I'd like the call to list() to behave as though the text had been entered directly so that you get list(1:2, 3:4, 5:6) [[1]] [1] 1 2 [[2]] [1] 3 4 [[3]] [1] 5 6 eval(parse(text=paste(list(,to.convert,),sep=))) [[1]] [1] 1 2 [[2]] [1] 3 4 [[3]] [1] 5 6 [[4]] [1] 7 8

Re: [R] x,y,z table to matrix with x as rows and y as columns

2007-07-24 Thread Mark Lyman
. mydat - expand.grid(x=1:5, y=1:5) mydat - data.frame(mydat, z=rnorm(25)) mydat$z[sample(1:25,4)] - NA mytab - xtabs(z~x+y, mydat) Mark Lyman __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] x,y,z table to matrix with x as rows and y as columns

2007-07-24 Thread Mark Lyman
(unique(x), unique(y)) + out + } with(mydat, data2mat(x, y, z)) Mark Lyman __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide