[R] Timing benefits of mapply() vs. for loop was: Wrap a loop inside a function

2006-07-20 Thread Doran, Harold
List: Thank you for the replies to my post yesterday. Gabor and Phil also gave useful replies on how to improve the function by relying on mapply rather than the explicit for loop. In general, I try and use the family of apply functions rather than the looping constructs such as for, while etc as

Re: [R] Timing benefits of mapply() vs. for loop was: Wrap a loop inside a function

2006-07-20 Thread Doran, Harold
, 2006 8:56 AM To: Doran, Harold Cc: r-help@stat.math.ethz.ch; Phil Spector Subject: Re: Timing benefits of mapply() vs. for loop was: [R] Wrap a loop inside a function Note that if you use mapply in the way I suggested, which is not the same as in your post, then its just as fast. (Also

Re: [R] Progress in a loop

2006-07-19 Thread Doran, Harold
Look for progress() in the svMisc package -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Florent Bresson Sent: Wednesday, July 19, 2006 10:13 AM To: r-help@stat.math.ethz.ch Subject: [R] Progress in a loop Hi, I have to use a loop to perform a

[R] Wrap a loop inside a function

2006-07-19 Thread Doran, Harold
I need to wrap a loop inside a function and am having a small bit of difficulty getting the results I need. Below is a replicable example. # define functions pcm - function(theta,d,score){ exp(rowSums(outer(theta,d[1:score],'-')))/ apply(exp(apply(outer(theta,d, '-'), 1, cumsum)), 2,

Re: [R] Wrap a loop inside a function

2006-07-19 Thread Doran, Harold
Very true, the resounding echo was large. Thanks, Doug. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Douglas Bates Sent: Wednesday, July 19, 2006 4:20 PM To: Doran, Harold Cc: r-help@stat.math.ethz.ch Subject: Re: [R] Wrap a loop inside

Re: [R] Random structure of nested design in lme

2006-07-19 Thread Doran, Harold
Can you provide an example of what you have done with lme so we might be able to evaluate the issue? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of ESCHEN Rene Sent: Wednesday, July 19, 2006 7:37 AM To: r-help@stat.math.ethz.ch Subject: [R]

Re: [R] non positive-definite G matrix in mixed models: bootstrap?

2006-07-11 Thread Doran, Harold
There is a paper by Rogosa and Saner which shows some equivalences in what you are doing under certain conditions. They show similarities between bootstrapping with linear models and how the estimates might be similar to those obtained from a mixed model. Rogosa, D. R., and Saner, H. M. (1995).

Re: [R] storing the estimates from lmer

2006-07-11 Thread Doran, Harold
You need the VarCorr function. I think you mean that lmer is in the Matrix package. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of prabhu bhaga Sent: Tuesday, July 11, 2006 11:19 AM To: r-help@stat.math.ethz.ch Subject: [R] storing the estimates

Re: [R] lme convergence

2006-06-30 Thread Doran, Harold
In the old version of lme, one could construct a grouped data object and this would alleviate the need to specify the random portion of the model. So, Spencer's call is equivalent to fm1 - lme(distance ~ age, random= ~age| Subject, data = Orthodont) This condition does not hold under lmer,

Re: [R] lme4 - higher level

2006-06-28 Thread Doran, Harold
Brian Additional covariates would be included in the fixed portion of the model. For example test.1 - lmer(y ~ b1 + b2 + b3 +age+sex+...+ (1 | group), org.data) From: [EMAIL PROTECTED] on behalf of Brian Perron Sent: Wed 6/28/2006 12:25 PM To:

Re: [R] PowerPoint

2006-06-23 Thread Doran, Harold
Use the functions in library(grDevices) for jpeg, bmp, or png formats. Or, you can use postscript() for an eps file. Of course, I personally think tex files make for much better looking presentations if you can be persuaded. Harold -Original Message- From: [EMAIL PROTECTED]

Re: [R] Vector Manipulation

2006-06-16 Thread Doran, Harold
I think you want ifelse(x=='N',0,1) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Davis, Jacob B. Sent: Friday, June 16, 2006 4:46 PM To: r-help@stat.math.ethz.ch Subject: [R] Vector Manipulation I have a vector that has 1,974 elements

[R] Subset data in long format

2006-06-06 Thread Doran, Harold
I have data in a long format where each row is a student and each student occupies multiple rows with multiple observations. I need to subset these data based on a condition which I am having difficulty defining. The dataset I am working with is large, but here is a simple data structure to

Re: [R] Subset data in long format

2006-06-06 Thread Doran, Harold
' , direction='long') long - long[order(long$id) , ] long - long[c(-2,-13),] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Doran, Harold Sent: Tuesday, June 06, 2006 5:08 PM To: r-help@stat.math.ethz.ch Subject: [R] Subset data in long format I have

Re: [R] How to use lmer function and multicomp package?

2006-06-04 Thread Doran, Harold
Comments below: mod1-lmer(sp~cla+(1|cla:plotti), data=bacaro, family=poisson(link=log)) summary(mod1) #sunto del modello Generalized linear mixed model fit using PQL Formula: sp ~ cla + (1 | cla:plotti) Data: bacaro Family: poisson(log link) AIC BIC

Re: [R] Help: lme

2006-06-01 Thread Doran, Harold
Pryseley: You asked this question last week and received answers to that question along with other suggestions from Doug Bates and myself. Is there some reason the post by Andrew Robinson is not working? Harold -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On

Re: [R] Help: lme

2006-06-01 Thread Doran, Harold
. From: Pryseley Assam [mailto:[EMAIL PROTECTED] Sent: Thursday, June 01, 2006 9:38 AM To: Doran, Harold Cc: r-help@stat.math.ethz.ch Subject: RE: [R] Help: lme Good day, Yeah i tried most of the suggestions

Re: [R] average by group...

2006-05-30 Thread Doran, Harold
?tapply -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of r user Sent: Tuesday, May 30, 2006 12:27 PM To: rhelp Subject: [R] average by group... I have a dataframe with 700,000 rows and 2 vectors (columns): group and score. I wish to

Re: [R] average by group...

2006-05-30 Thread Doran, Harold
PROTECTED] On Behalf Of Peter Dalgaard Sent: Tuesday, May 30, 2006 1:09 PM To: Doran, Harold Cc: r user; rhelp Subject: Re: [R] average by group... Doran, Harold [EMAIL PROTECTED] writes: ?tapply Nope. ?ave -Original Message- From: [EMAIL PROTECTED] [mailto

Re: [R] query: lme

2006-05-29 Thread Doran, Harold
As noted below, it is hard to diagnose the specific issue. But, as a recommendation, I would suggest using lmer and then investigating the parameters of the model using the MCMCsamp() function. You can then do all diagnostics using the various functions in the coda package as MCMCsamp()

Re: [R] Can lmer() fit a multilevel model embedded in a regression?

2006-05-23 Thread Doran, Harold
for correlations in the data by incorporating random effects. HTH, Harold -Original Message- From: Andrew Gelman [mailto:[EMAIL PROTECTED] Sent: Mon 5/22/2006 11:12 AM To: Doran, Harold Cc: r-help@stat.math.ethz.ch; [EMAIL PROTECTED] Subject:Re: [R] Can lmer() fit

Re: [R] Can lmer() fit a multilevel model embedded in a regression?

2006-05-22 Thread Doran, Harold
be missing something. -Original Message- From: Andrew Gelman [mailto:[EMAIL PROTECTED] Sent: Sun 5/21/2006 7:35 PM To: Doran, Harold Cc: r-help@stat.math.ethz.ch; [EMAIL PROTECTED] Subject:Re: [R] Can lmer() fit a multilevel model embedded in a regression? Harold, I

[R] Subset a list

2006-05-22 Thread Doran, Harold
I have a data frame of ~200 columns and ~20,000 rows where each column consists of binary responses (0,1) and a 9 for missing data. I am interested in finding the columns for which there are fewer than 100 individuals with responses of 0. I can use an apply function to generate a table for each

Re: [R] Can lmer() fit a multilevel model embedded in a regression?

2006-05-21 Thread Doran, Harold
Prof Gelman: I believe the answer is yes. It sounds as though persons are partially crossed within food items? Assuming a logit link, the syntax might follow along the lines of fm1 - lmer(DV ~ foods + sex + age + (1|food_item), data, family = binomial(link='logit'), method = Laplace,

Re: [R] lmer, p-values and all that

2006-05-20 Thread Doran, Harold
here here. I had the wonderful benefit of sitting in a coffee shop in San Francisco with Doug listening to an excellent explanation. I only wish we could replicate that as an FAQ! Thanks for this, Doug. -Original Message- From: [EMAIL PROTECTED] on behalf of Marc Schwartz Sent:

Re: [R] Interrater and intrarater variability (intraclass correlationcoefficients)

2006-05-17 Thread Doran, Harold
[mailto:[EMAIL PROTECTED] Sent: Wednesday, May 17, 2006 1:50 AM To: Doran, Harold; r-help@stat.math.ethz.ch Subject: AW: [R] Interrater and intrarater variability (intraclass correlationcoefficients) Dear Harold, Thanks! I searched for Hoyt's Anova in R - but without success. Do you

Re: [R] Interrater and intrarater variability (intraclass correlationcoefficients)

2006-05-16 Thread Doran, Harold
It sounds as thought you are interested in Hoyt's Anova which is a form of generalizability theory. This is usually estimated using by getting the variance components from ANOVA. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Karl Knoblick Sent:

Re: [R] anova statistics in lmer

2006-05-15 Thread Doran, Harold
The issue is not unresolved within lmer, but with the statistical model itself. SAS gives you alternatives for the ddf such as Kenward-Roger. But, as I have noted on the list before, this makes the assumption that the ratio of the variances follow an F distribution and that the only remaining

Re: [R] Spline integration Gaussian quadrature (was: gauss.quad.prob)

2006-05-06 Thread Doran, Harold
reasonable rates of convergence for many integrals that I thought should be reasonably well behaved. However, as I mentioned above, my work in this area suggested I might more wisely invest my time in spline integration. Best Wishes, spencer graves Doran, Harold wrote

Re: [R] F-statistic in lme

2006-05-05 Thread Doran, Harold
Kevin They do not exist. This question has come up often. Try the following to see a thread RSiteSearch('lmer p-values') Harold -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Hai Lin Sent: Friday, May 05, 2006 12:46 PM To:

Re: [R] Determining the memory used by a dataset or vector?

2006-05-04 Thread Doran, Harold
You can use object.size() -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of r user Sent: Thursday, May 04, 2006 2:56 PM To: rhelp Subject: [R] Determining the memory used by a dataset or vector? Is there a function that reports the amount of

[R] gauss.quad.prob

2006-04-28 Thread Doran, Harold
I've written a series of functions that evaluates an integral from -inf to a or b to +inf using equally spaced quadrature points along a normal distribution from -10 to +10 moving in increments of .01. These functions are working and give very good approximations, but I think they are

Re: [R] R help

2006-04-25 Thread Doran, Harold
Ezra I don't know what the elements of your matrix are, but if there are a large proportion of 0s you can work with sparse matrices in the Matrix package. Harold -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Erez Sent: Tuesday, April 25, 2006 8:39

[R] Store results of for loop

2006-04-24 Thread Doran, Harold
I have what I'm sure will turn out to be straightforward. I want to store the results of a loop for some operations from a patterned vector. For example, the following doesn't give what I would hope for ss - c(2,3,9) results - numeric(length(ss)) for (i in seq(along=ss)){ results[i] - i + 1

[R] Monitor() in R2WinBUGS

2006-04-22 Thread Doran, Harold
I have an array from an mcmc simulation and I'd like to try and use the monitor function in R2WinBUGS. The R2WinBUGS package is in the search path and when I try help(monitor) the help page appears for the function. But, when I try and use it the following happens: monitor(sims) Error: couldn't

Re: [R] Missing p-values using lmer()

2006-04-20 Thread Doran, Harold
You didn't do anything wrong, lmer doesn't give them. And, for good reason. I've been a bit indoctrinated by D. Bates, so let me share what I've learned. With simple analysis of variance models with simple error structures, it is known that the ratio of the variances follow and F distribution.

Re: [R] Missing p-values using lmer()

2006-04-20 Thread Doran, Harold
: Thursday, April 20, 2006 2:23 PM To: Doran, Harold Cc: Amelie LESCROEL; r-help@stat.math.ethz.ch Subject: Re: [R] Missing p-values using lmer() Hi, Harold: Am I correct that the tool currently preferred for estimating p-values for lmer is mcmcsamp? Amélie: My favorite tool for exploring

[R] Function to approximate complex integral

2006-04-19 Thread Doran, Harold
I am writing a small function to approximate an integral that cannot be evaluated in closed form. I am partially successful at this point and am experiencing one small, albeit important problem. Here is part of my function below. This is a psychometric problem for dichotomously scored test

[R] Basic vector operations was: Function to approximate complex integral

2006-04-19 Thread Doran, Harold
do not know of a built in function that would do this. Any suggestions? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Doran, Harold Sent: Wednesday, April 19, 2006 11:51 AM To: r-help@stat.math.ethz.ch Subject: [R] Function to approximate complex integral

Re: [R] Basic vector operations was: Function toapproximate complex integral

2006-04-19 Thread Doran, Harold
Yup, thanks, all . I tried outer but didn't sum the elements before I posted. Thanks -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Marc Schwartz (via MN) Sent: Wednesday, April 19, 2006 3:46 PM To: Doran, Harold Cc: r-help@stat.math.ethz.ch Subject: Re

Re: [R] Penalized Splines as BLUPs using lmer?

2006-04-14 Thread Doran, Harold
!), will we be able to specify the cov structure of the random effects similarly to what was done in lme(), i.e. using pdMat objects and so forth? Thanks! joran On Apr 13, 2006, at 3:34 PM, Doran, Harold wrote: I think you want the random effects to be independent. If so then you need lmer

Re: [R] obtaining residuals from lmer

2006-04-13 Thread Doran, Harold
resid(model) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bill Shipley Sent: Thursday, April 13, 2006 10:55 AM To: R help list Subject: [R] obtaining residuals from lmer Hello. I cannot find out how to extract the residuals from a mixed model using

[R] Subset rows over multiple columns

2006-04-13 Thread Doran, Harold
I have a data frame where I need to subset certain rows before I compute the mean of another variable. However, the value that I need to subset by is found in multiple columns. For example, in the data below the value R160 is found in the first and second columns (itd_1 and itd_45). These

Re: [R] Penalized Splines as BLUPs using lmer?

2006-04-13 Thread Doran, Harold
I think you want the random effects to be independent. If so then you need lmer(response ~ time +(time|id) + (time-1|id), data) Harold -Original Message- From: [EMAIL PROTECTED] on behalf of Matthias Kormaksson Sent: Thu 4/13/2006 4:04 PM To: r-help@stat.math.ethz.ch Cc:

Re: [R] lm - Generalized Inverse

2006-04-04 Thread Doran, Harold
You can do this yourself with ginv() -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Cal Stats Sent: Monday, April 03, 2006 7:40 PM To: r-help@stat.math.ethz.ch Subject: [R] lm - Generalized Inverse Hi, is there a lm which will implement the

[R] Lmer BLUPS: was(lmer multilevel)

2006-03-29 Thread Doran, Harold
Paul: I may have found the issue (which is similar to your conclusion). I checked using egsingle in the mlmRev package as these individuals are strictly nested in this case: library(mlmRev) library(nlme) fm1 - lme(math ~ year, random=~1|schoolid/childid, egsingle) fm2 - lmer(math ~ year

Re: [R] Scaling behavior ov bVar from lmer models

2006-03-21 Thread Doran, Harold
Alan: I think you need to multiply the values in the bVar slot by th residual variance to get the correct estimates. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Alan Bergland Sent: Tuesday, March 21, 2006 6:31 AM To: r-help@stat.math.ethz.ch

Re: [R] does lme repeated measures require sphericity?

2006-03-20 Thread Doran, Harold
John: Linear models can have different covariance structures to accommodate certain dependencies in the data. The functions for data analysis in the lme4 package are flexible and can be structured as such. For example, when random intercepts only are included, this is akin to compound symmetry,

Re: [R] Mixed-Effects Models in S and S-Plus (Springer)

2006-03-20 Thread Doran, Harold
Well, not if you are interested in lmer() syntax. The book is good with the conceptual issues in modeling the data, but does not include any reference to fitting models with lmer. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gregor Gorjanc Sent:

Re: [R] cat(), Rgui, and support for carriage return \r...

2006-03-17 Thread Doran, Harold
Here is a snip of code I used in a program that was looping for a really long time, maybe this can be helpful. You will need the svMisc package. print(i) progress(i) Sys.sleep(.05) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jeffrey Racine Sent:

Re: [R] generating RANDOM ROWS from matrix

2006-03-15 Thread Doran, Harold
Is something like this what your looking for: x - matrix(c(rnorm(100)),ncol=10) sub - sample(5, replace=TRUE) # For sampling with replacement x[sub,] Harold -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of mark salsburg Sent: Wednesday, March 15,

Re: [R] Transferring R results to word prosessors

2006-02-10 Thread Doran, Harold
I didn't follow this thread entirely, but I did make a LaTeX recommendation and I know that wasn't what you were asking for. But, if I may, let me respond to the ideas you present below in an attempt to be somewhat persuasive. IMHO, this are horrible inefficiencies of SPSS and other packages,

Re: [R] Tranferring R results to word prosessors

2006-02-09 Thread Doran, Harold
Well, I don't know if it can be used with Word or not, but you might consider Sweave for use with LaTeX. Maybe if you use the sink() command this might work, but I haven't tried it. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tom Backer Johnsen Sent:

Re: [R] lme syntax for PB examples

2006-02-08 Thread Doran, Harold
Paul: It is a little difficult to understand what you are trying to translate since you do not show what the model would look like using lme. If you show lme, then it is easy to translate into lmer syntax. A few thoughts, first, use lmer in the Matrix package and not in lme4. Second, see the

Re: [R] R- License

2006-02-07 Thread Doran, Harold
Type license() for this info -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Tuesday, February 07, 2006 8:50 AM To: r-help@stat.math.ethz.ch Subject: [R] R- License Hello. We are trying to install R on our network, and I wanted to

[R] Help with boot()

2006-01-31 Thread Doran, Harold
Dear List: I'm trying to use the boot function to estimate some standard errors. I actually programmed a bootstrap using some homebrew code and it worked fine. But, I am trying to use the more efficient boot function. I have placed some sample data for replication of my problem at the bottom of

Re: [R] nested ANCOVA: still confused

2006-01-25 Thread Doran, Harold
Stratford [mailto:[EMAIL PROTECTED] Sent: Tue 1/24/2006 8:57 PM To: Doran, Harold; r-help@stat.math.ethz.ch Cc: Subject:RE: [R] nested ANCOVA: still confused R-users and Harold. First, thanks for the advice; I'm almost there. The code I'm using now is library(nlme) bb - read.csv

Re: [R] paste - eliminate spaces?

2006-01-25 Thread Doran, Harold
Try paste('test',1,sep='') -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of r user Sent: Wednesday, January 25, 2006 1:58 PM To: rhelp Subject: [R] paste - eliminate spaces? I am trying to combine the value of a variable and text. e.g. I want test1,

Re: [R] nested ANCOVA: still confused

2006-01-24 Thread Doran, Harold
Dear Jeff: I see the issues in your code and have provided what I think will solve your problem. It is often much easier to get help on this list when you provide a small bit of data that can be replicated and you state what the error messages are that you are receiving. OK, with that said, here

Re: [R] Multilevel models with mixed effects in R?

2006-01-12 Thread Doran, Harold
Yes, there are now multiple functions. One is the lmer() function in the matrix package. Another is in the nlme package and is the lme() function. Lmer is the newer version and the syntax has changed just slightly. To see samples of the lmer function type the following at your R command prompt

Re: [R] warning message from nlme

2006-01-09 Thread Doran, Harold
Yen Lin: I'd like to try and offer a little help, but I'm still unclear on your data structure and problem. You say, they are all categorical variables. But, does this apply also to your dependent variable? If so, lme is the wrong function to use. You also say you want to decompose tha variation

Re: [R] Understanding and translating lme() into lmer() model

2006-01-05 Thread Doran, Harold
Peter: Almost correct. You need to add the variance component for the highest level of nesting, so your model would be lmer.m1.1 = lmer(Y~A+B+C+(1|D:E) + (1|E), data=data,method=ML) But, yes, the : is used to note implicit nesting in lmer similar to the syntax used for / in lme. The syntax

Re: [R] Including random effects in logistic regression.

2006-01-03 Thread Doran, Harold
Jason the lmer() function in the Matrix package is what you will need. -Original Message- From: [EMAIL PROTECTED] on behalf of Jason Marshal Sent: Tue 1/3/2006 8:10 AM To: r-help@stat.math.ethz.ch Cc: Subject:[R] Including random effects in logistic regression.

Re: [R] bVar slot of lmer objects and standard errors

2005-12-29 Thread Doran, Harold
Uli: The graphic in the paper, sometimes called a catepillar plot, must be created with some programming as there is (as far as I know) not a built-in function for such plots. As for the contents of bVar you say the dimensions are 2,2,28 and there are two random effects and 28 schools. So, from

Re: [R] lme4: Extract fixed effects Val, SE, t, p

2005-12-16 Thread Doran, Harold
There are certain functions which can easily extracts the various components, however. For instance, you can grab the fixed effects using fixef(), the variance components using VarCorr, and the standard errors of the fixed effects using vcov() -Original Message- From: [EMAIL PROTECTED]

Re: [R] How to simulate correlated data

2005-12-15 Thread Doran, Harold
See ?mvrnorm -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Lisa Wang Sent: Thursday, December 15, 2005 10:34 AM To: R-Help Subject: [R] How to simulate correlated data Hello there, I would like to simulate X --Normal (20, 5)

Re: [R] Fitting binomial lmer-model, high deviance and low logLik

2005-12-14 Thread Doran, Harold
If you suspect a local maxima, have you tried different starting to values to see if the likelihood is maximized in the same place? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ivar Herfindal Sent: Wednesday, December 14, 2005 5:34 AM To:

[R] Translation Dictionary (Rosetta Stone)

2005-12-14 Thread Doran, Harold
Dear List: A while back I found a web site called the Rosetta Stone for Computer Algebra Systems showing how to do similar operations in different symbolic programs. This has been very helpful for moving between Mathematica, Yacas and Maxima. I wonder if anyone maintains something akin to this

[R] Technique for reading large sparse fwf data file

2005-12-13 Thread Doran, Harold
Dear list: A datafile was sent to me that is very large (92890 x 1620) and is *very* sparse. Instead of leaving the entries with missing data blank, each cell with missing data contains a dot (.) The data are binary in almost all columns, with only a few columns containing whole numbers,

Re: [R] Technique for reading large sparse fwf data file

2005-12-13 Thread Doran, Harold
?) Clearly, enough memory is allocated to handle this file. But, I also wonder why R then locks and I need to do a forced shut down. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Doran, Harold Sent: Tuesday, December 13, 2005 5:33 AM To: r-help

Re: [R] Matrix Problem

2005-12-09 Thread Doran, Harold
Beyond asking why, and not letting R do work for you, let me just note that inverting the full matrix is often computationally wasteful. You can take the Cholesky decomposition M = L'L where M is your matrix and then only work with L. Other than that, there are two packages for dealing with sparse

Re: [R] Matrix of dummy variables from a factor

2005-12-06 Thread Doran, Harold
Good point. Probably not for any subsequent use in R. But, I work in an org that uses SAS, HLM, SPSS, among others. As a part of our control processes at times we replicate analyses in different software programs. For instance, we will replicate lmer functions using HLM. But, HLM requires a matrix

[R] Broken links on CRAN

2005-12-05 Thread Doran, Harold
Dear List: When I click on the link to download a reference manual for a package on cran, I get an error message that the file is damaged and could not be repaired. I randomly chose various packages and the same error message appears. Are the links actually broken? I have also restarted my

Re: [R] Broken links on CRAN

2005-12-05 Thread Doran, Harold
, Harold Cc: r-help@stat.math.ethz.ch Subject: Re: [R] Broken links on CRAN Doran, Harold [EMAIL PROTECTED] writes: Dear List: When I click on the link to download a reference manual for a package on cran, I get an error message that the file is damaged and could not be repaired. I randomly

Re: [R] Broken links on CRAN

2005-12-05 Thread Doran, Harold
Hi Duncan I tried various ones, but try ash.pdf. I was not able to work with this file. But, when I go to another mirror, I can open this file no problem. Harold -Original Message- From: Duncan Murdoch [mailto:[EMAIL PROTECTED] Sent: Monday, December 05, 2005 3:00 PM To: Doran, Harold

Re: [R] covariance structures in lmer

2005-12-02 Thread Doran, Harold
Stephan: It is my understanding that the corClass functions are not able to be used with lmer() at this time. Harold -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Stephan Moratti Sent: Friday, December 02, 2005 6:58 AM To: r-help@stat.math.ethz.ch

[R] Simulate Correlated data from complex sample

2005-12-01 Thread Doran, Harold
Dear List: I have created some code to simulate data from a complex sample where 5000 students are nested in 50 schools. My code returns a dataframe with a variable representing student achievement at a single time point. My actual code for creating this is below. What I would like to do is

Re: [R] Random Effects for One-Way Anova

2005-11-30 Thread Doran, Harold
Giuseppe GIven the information below it is difficult to provide help. But, you might use the lmer() function in the Matrix package in a fashion such as lmer(A ~ B +(1|ID), data) where ID is a grouping variable. There are plently of papers on lme and lmer in the R news as well as a book by

[R] rlogis() in simulation

2005-11-29 Thread Doran, Harold
Dear List: We are generating data such that students are clustered in schools for some item response data for a simulation study. One component of our simulation is to generate measurement error from a logistic distribution with a mean of 0 and standard deviation of 1.7 to match the logistic

Re: [R] IRT Package

2005-11-27 Thread Doran, Harold
I do not believe another IRT package exists. However, I have recently used the rasch() function in ltm for a study I am doing and have found it very useful. I'm curious (as I'm sure the ltm developer is) as to what are you doing that ltm cannot handle. Harold -Original Message-

Re: [R] nlme question

2005-11-17 Thread Doran, Harold
James, By assumption, sigma and tau are assumed uncorrelated, which I believe Deepayan noted below. Sigma is also random error so it is uncorrelated with your fixed effects. What are the covariance terms you are seeking? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL

Re: [R] nlme question

2005-11-17 Thread Doran, Harold
related to a fixed effect, then your model is misspecified and there are omitted characteristics that need to be accounted for. -Original Message- From: Wassell, James T., Ph.D. [mailto:[EMAIL PROTECTED] Sent: Thursday, November 17, 2005 11:52 AM To: Doran, Harold; r-help@stat.math.ethz.ch

Re: [R] no package 'Matrix' at the repositories

2005-11-11 Thread Doran, Harold
I don't have an answer, but also want to point out that whenever I try and download the pdf documentation associated with a package, my Acrobat opens but tells me the file is corrupted. I did this for a random selection of packages and the same problem seems to reoccur. I'm not sure if this is

Re: [R] glmmpql and lmer keep failing

2005-11-01 Thread Doran, Harold
Sorry to be blunt, but to make the statement that it is unacceptable without providing any reason why the model may fail to converge seems a little presumptious. Your statement really bothers me, especially knowing how hard the developer works on keeping this function at a premier level. Ask

Re: [R] Random effect models

2005-10-28 Thread Doran, Harold
Dear Jacques I think your question is a little confusing, but let me take a stab at what I think you're getting at. It seems you are trying to find the statistical significance of a variance component in your lme model, and not the significance of a fixed effect. If this is what you are looking

Re: [R] F tests for random effect models

2005-10-27 Thread Doran, Harold
I think what you're looking for is in anova() fm1 - lmer(dv ~ IV ...) anova(fm1) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jacques VESLOT Sent: Thursday, October 27, 2005 2:22 AM To: R-help@stat.math.ethz.ch Subject: [R] F tests for random

Re: [R] R-help Digest, Vol 32, Issue 26

2005-10-26 Thread Doran, Harold
Doran, Harold [EMAIL PROTECTED] responded: There is an issue with implicit nesting in lmer. In your lme() model you nest block/irrigation/density/fertilizer. In lmer you need to do something like (I dind't include all of your variables, but I think the makes the point) lmer(yield~irrigation

Re: [R] lme and lmer syntax

2005-10-25 Thread Doran, Harold
syntax Em Seg 24 Out 2005 18:08, Doran, Harold escreveu: Ronaldo See the article on lmer pasted below for syntax. It is the only current source documenting the code. In lmer(), the nesting structure for the ranmdom effects is handled in a slightly different way. If your observations

Re: [R] lme and lmer syntax

2005-10-24 Thread Doran, Harold
Ronaldo See the article on lmer pasted below for syntax. It is the only current source documenting the code. In lmer(), the nesting structure for the ranmdom effects is handled in a slightly different way. If your observations are nested as you note, then you can use lmer(y~x1 + x2 +(1|x1) +

Re: [R] R: source

2005-10-14 Thread Doran, Harold
Use file.choose() instead source(file.choose()) This will open a dialogue box and might be easier for you to find your file. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Clark Allan Sent: Friday, October 14, 2005 7:06 AM To:

Re: [R] Clear Console

2005-09-30 Thread Doran, Harold
Ctrl L -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Leonardo L Miceli Sent: Friday, September 30, 2005 8:36 AM To: r-help@stat.math.ethz.ch Subject: [R] Clear Console Hi, What is the function to clear the console? tks [[alternative HTML

Re: [R] how to fix the level-1 variances in lme()?

2005-09-29 Thread Doran, Harold
Mike I do not believe this is availabe in either lme or lmer in R, only S-Plus. -Original Message- From: [EMAIL PROTECTED] on behalf of Mike Cheung Sent: Thu 9/29/2005 4:32 AM To: r-help@stat.math.ethz.ch Cc: Subject:[R] how to fix the level-1 variances in lme()?

Re: [R] standard error of variances and covariances of the random effects with LME

2005-09-29 Thread Doran, Harold
You cannot. Also, it's not that the distribution of the random effects is not symmetric, but that it *may* not be symmetric, and this is an assumption that should be checked. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Roel de Jong Sent: Thursday,

Re: [R] Saving Graphics

2005-09-29 Thread Doran, Harold
See ?pdf or ?postscript -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mike Jones Sent: Thursday, September 29, 2005 3:22 PM To: r-help@stat.math.ethz.ch Subject: [R] Saving Graphics Hello all, I'm having difficulty automatically saving graphs. Is

Re: [R] Possible bug in lmer nested analysis with factors

2005-09-16 Thread Doran, Harold
I think you might have confused lme code with lmer code. Why do you have c/d in the random portion? I think what you want is lmer(a ~ b + (1 | c)+(1|d)) Which gives the following using your data Linear mixed-effects model fit by REML Formula: a ~ b + (1 | c) + (1 | d) AIC BIC

Re: [R] Possible bug in lmer nested analysis with factors

2005-09-16 Thread Doran, Harold
: Re: [R] Possible bug in lmer nested analysis with factors On 16 Sep 2005, at 17:12, Doran, Harold wrote: I think you might have confused lme code with lmer code. Why do you have c/d in the random portion? Apologies. I obviously have done something of the sort. I assumed that the 'random

Re: [R] remedial stats education

2005-09-12 Thread Doran, Harold
There is a Springer publication All of Statistics: a concise course in statistical inference by Larry Wasserman that might be what you are looking for. The book also has an emphasis on R and his web site has code and data sets for analysis of the examples used throughout. -Harold -Original

Re: [R] Translating lme model call to lme4

2005-09-12 Thread Doran, Harold
Only the random portion will differ as in: lmer(lognrms ~ Group*Rotation*muscle*side*support*arms + (1|Subject) + (1|Stratum) + (1|rep), Data) -Original Message- From: [EMAIL PROTECTED] on behalf of Ross Darnell Sent: Mon 9/12/2005 9:28 PM To: r-help@stat.math.ethz.ch Cc:

[R] Off-topic: Comparing standard errors from simulation and analytical model

2005-09-09 Thread Doran, Harold
Dear list: I'm hoping to tap in to the statistical expertise in the group, especially those familiar with simulation techniques. I'm finalizing a study where I obtain standard errors from two sources. The first source is a monte carlo simulation and the other source is an analytical model I have

[R] VarCorr function for assigning random effects: was Question

2005-09-01 Thread Doran, Harold
If you are indeed using lme and not lmer then the needed function is VarCorr(). However, 2 recommendations. First, this is a busy list and better emails subject headers get better attention. Second, I would recommend using lmer as it is much faster. However, VarCorr seems to be incompatible with

<    1   2   3   >