Re: [R] How to invert a matrix in R?

2014-06-19 Thread Douglas Bates
On Wed, Jun 18, 2014 at 2:26 PM, Judson judsonbl...@msn.com wrote: Dear Dr. Bates, I'm just learning R and I want to use it for statistical problems and also some problems that are just mathematical. Apparently I'm not using the packages right and none of the books I've found cover

Re: [R] fdHess function

2013-01-22 Thread Douglas Bates
Your question is better addressed to the R-help@R-project.org mailing list, which I am copying on this reply. You are confusing a statistical concept, the Fisher Information matrix, with a numerical concept, the Hessian matrix of a scalar function of a vector argument. The Fisher information

Re: [R] prevalence of R in publications and institutions

2012-08-17 Thread Douglas Bates
On Fri, Aug 17, 2012 at 6:46 AM, Travis Perry travis.pe...@furman.edu wrote: Dr. Bates, Our department is considering replacing existing statistical software packages in our curriculum with R, at my request. To better inform this decision we are interested to know the prevalence of

Re: [R] Creating sparse matrix of type dgCMatrix directly

2012-07-28 Thread Douglas Bates
On Sat, Jul 28, 2012 at 7:26 AM, Søren Højsgaard sor...@math.aau.dk wrote: I want to create a sparse matrix of type dgCMatrix using the Matrix package (and the matrix must be of this type even if other more compact representations may exist). I do library(Matrix)

Re: [R] Getting codebook data into R

2012-02-09 Thread Douglas Bates
On Thu, Feb 9, 2012 at 2:51 PM, barny garyb.dav...@btinternet.com wrote: I've been trying to get some data from the National Survey for Family Growth into R - however, the data is in a .dat file and the data I need doesn't have any spaces or commas separating fields - rather you have to look

Re: [R] regarding QRb() function

2011-12-28 Thread Douglas Bates
2011/12/28 Uwe Ligges lig...@statistik.tu-dortmund.de: On 26.12.2011 15:30, narendarreddy kalam wrote: Error in `[.data.frame`(x, order(x, na.last = na.last, decreasing = decreasing)) :    undefined columns selected during the execution of following r sequence of commands

Re: [R] column permutation of sparse matrix

2011-12-20 Thread Douglas Bates
On Tue, Dec 20, 2011 at 8:20 AM, Jean V Adams jvad...@usgs.gov wrote: Hi Jean, khai wrote on 12/19/2011 11:26:55 PM: Hi, I'm very new to working with sparse matrices and would like to know how I can column permute a sparse matrix. Here is a small example: M1 -

Re: [R] MIXED MODEL WITH REPEATED MEASURES

2011-12-07 Thread Douglas Bates
On Dec 7, 2011 4:44 PM, Erin Ryan e...@the-ryans.com wrote: I am trying to specify a mixed model for my research, but I can't quite get it to work. I've spent several weeks looking thru various online sources to no avail. I can't find an example of someone trying to do precisely what I'm

Re: [R] S4 vs Reference Classes

2011-09-13 Thread Douglas Bates
On Tue, Sep 13, 2011 at 12:54 PM, Joseph Park jpark...@att.net wrote:   Hi, I'm looking for some guidance on whether to use   S4 or Reference Classes for an analysis application   I'm developing.   I'm a C++/Python developer, and like to 'think' in OOD.   I started my app with S4, thinking

Re: [R] S4 vs Reference Classes

2011-09-13 Thread Douglas Bates
On Tue, Sep 13, 2011 at 4:11 PM, Steve Lianoglou mailinglist.honey...@gmail.com wrote: Hi, On Tue, Sep 13, 2011 at 1:54 PM, Joseph Park jpark...@att.net wrote:   Hi, I'm looking for some guidance on whether to use   S4 or Reference Classes for an analysis application   I'm developing.  

Re: [R] R Crashes when using large matrices (Ubuntu 11.04)

2011-06-04 Thread Douglas Bates
On Fri, Jun 3, 2011 at 7:03 PM, Matias Salibian-Barrera msalib...@yahoo.ca wrote: Hello, This simple SVD calculation (commands are copied immediately below) crashes on my Ubuntu machine (R 2.13.0). However it works fine on my Windows 7 machine, so I suspect there's a problem with (my?)

Re: [R] Can R replicate this data manipulation in SAS?

2011-04-22 Thread Douglas Bates
On Thu, Apr 21, 2011 at 5:34 PM, peter dalgaard pda...@gmail.com wrote: On Apr 21, 2011, at 16:00 , Bert Gunter wrote: Folks: It is perhaps worth noting that this is probably  a Type III error: right answer to the wrong question. The right question would be: what data structures and

Re: [R] Matrix package transpose

2011-04-20 Thread Douglas Bates
On Wed, Apr 20, 2011 at 8:37 AM, Tobias Abenius tobias.aben...@chalmers.se wrote: Since I installed R 2.13 I cannot use the transpose method t on sparse matrices inside my package. Outside the package works. Is there something new that I have to import methods? Can I then import everything

Re: [R] Conveting SAS Proc mixed to R code

2011-04-16 Thread Douglas Bates
On Fri, Apr 15, 2011 at 8:45 AM, Ben Bolker bbol...@gmail.com wrote: Kevin Wright kw.stat at gmail.com writes: I am trying to teach myself R and replicate some previous SAS analysis. Could someone please help me translate the following SAS code into R. Proc mixed method=ml Class Group

Re: [R] [Rcpp-devel] Find number of elements less than some number: Elegant/fastsolution needed

2011-04-15 Thread Douglas Bates
On Thu, Apr 14, 2011 at 11:47 PM, Christian Gunning x...@unm.edu wrote: On Thu, Apr 14, 2011 at 7:02 PM, rcpp-devel-requ...@r-forge.wu-wien.ac.at wrote: I was able to write a very short C++ function using the Rcpp package that provided about a 1000-fold increase in speed relative to the best

Re: [R] Find number of elements less than some number: Elegant/fastsolution needed

2011-04-14 Thread Douglas Bates
My colleague Sunduz Keles once mentioned a similar problem to me. She had a large sample from a reference distribution and a test sample (both real-valued in her case) and she wanted, for each element of the test sample, the proportion of the reference sample that was less than the element. It's

Re: [R] Find number of elements less than some number: Elegant/fastsolution needed

2011-04-14 Thread Douglas Bates
-project.org] On Behalf Of Douglas Bates [ba...@stat.wisc.edu] Sent: Thursday, April 14, 2011 6:22 PM To: William Dunlap Cc: r-help@r-project.org; Sunduz Keles; rcpp-devel; Kevin Ummel Subject: Re: [R] Find number of elements less than some number: Elegant/fastsolution needed My colleague Sunduz

Re: [R] Fwd: CRAN problem with plyr-1.4.1

2011-04-11 Thread Douglas Bates
The first thing to do is try another mirror. The official (or as official as we ever get about anything) U.S. mirror is http://cran.us.R-project.org They tend to be very good about updating. Presently the source package for plyr is at version 1.5 and the binary versions are both at 1.4.1 On

Re: [R] Getting number of students with zeroes in long format

2011-04-06 Thread Douglas Bates
On Wed, Apr 6, 2011 at 3:44 PM, Christopher Desjardins cddesjard...@gmail.com wrote: Hi, I have longitudinal school suspension data on students. I would like to figure out how many students (id_r) have no suspensions (sus), i.e. have a code of '0'. My data is in long format and the first 20

Re: [R] converting call objects into character

2011-04-03 Thread Douglas Bates
On Sun, Apr 3, 2011 at 11:42 AM, David Winsemius dwinsem...@comcast.net wrote: On Apr 3, 2011, at 12:14 PM, Samuel Le wrote: Dear all, I would like to log the calls to my functions. I am trying to do this using the function match.call(): fTest-function(x) {  theCall-match.call()      

Re: [R] nls.profile

2011-03-31 Thread Douglas Bates
On Thu, Mar 31, 2011 at 4:02 AM, Daniel Kaschek daniel.kasc...@physik.uni-freiburg.de wrote: Hello, I use nls.profile to compute confidence intervals of parameter estimates of a non-linear model. When computing the profiles, the model function produces an error for certain parameter

Re: [R] string interpolation

2011-03-21 Thread Douglas Bates
On Mon, Mar 21, 2011 at 2:03 PM, Justin Haynes jto...@gmail.com wrote: Is there a way to do this in R? I have data in the form: 57_input  57_output  58_input  58_output  etc. can i use a for loop (i in 57:n)  that plots only the outputs?  I want this to be robust so im not specifying a

Re: [R] Plotting individual trajectories from individual growth model

2011-02-22 Thread Douglas Bates
On Mon, Feb 21, 2011 at 10:06 PM, dadrivr dadr...@gmail.com wrote: Thanks Dennis, The code works for perfectly for the data in the example.  For some reason, however, I get the following error message when I use a different data set: preds - expand.grid(age = c(30,36,42), Subject =

Re: [R] [Rcpp-devel] Help with integrating R and c/c++

2011-02-19 Thread Douglas Bates
On Sat, Feb 19, 2011 at 12:56 AM, Rohit Pandey rohitpandey...@gmail.com wrote: Hi Christopher/ Dirk, Thank you very much for your replys. I think the idea of using inline as you suggest is the best way to start off with using c++ with R. I went through your examples and also plenty I found on

Re: [R] Pre-allocation of matrices is LESS efficient?

2011-02-17 Thread Douglas Bates
On Thu, Feb 17, 2011 at 10:02 AM, Alex F. Bokov ahupxo...@sneakemail.com wrote: Motivation: during each iteration, my code needs to collect tabular data (and use it only during that iteration), but the rows of data may vary. I thought I would speed it up by preinitializing the matrix that

Re: [R] Help with integrating R and c/c++

2011-02-06 Thread Douglas Bates
On Sun, Feb 6, 2011 at 10:56 AM, David Winsemius dwinsem...@comcast.net wrote: On Feb 6, 2011, at 10:28 AM, Rohit Pandey wrote: Hi, I have been using R for close to two years now and have grown quite comfortable with the language. I am presently trying to implement an optimization routine

Re: [R] [OT] BLUE vs. BLUP

2011-02-05 Thread Douglas Bates
On Fri, Feb 4, 2011 at 8:44 PM, Laura Smith smithlaura...@gmail.com wrote: Hi! Does anyone have a numeric example for calculating BLUE and BLUP, please? You will need to be more specific. BLUE is an acronym for Best Linear Unbiased Estimator and BLUP for Best Linear Unbiased Predictor. So the

Re: [R] Lmer binomial distribution x HLM Bernoulli distribution

2011-02-01 Thread Douglas Bates
On Tue, Feb 1, 2011 at 10:51 AM, Luana Marotta lucsmaro...@gmail.com wrote: Dear R-users, I'm running a lmer model using the lme4 package. My dependent variable is dichotomous and I'm using the binomial family. The results are slightly different from the HLM results based on a Bernoulli

Re: [R] Measure execution time

2011-01-27 Thread Douglas Bates
?system.time On Thu, Jan 27, 2011 at 10:31 AM, Alaios ala...@yahoo.com wrote: Dear list members, I would like to measure how much time one function call makes from the time is call until the time it returns. Could you please tell me if that is possible in R? Best Regards Alex

Re: [R] Does anybody knows the default value of starting value in glm?

2011-01-25 Thread Douglas Bates
On Tue, Jan 25, 2011 at 1:14 PM, Akram Khaleghei Ghosheh balagh a.khaleg...@gmail.com wrote: Hello ; Do you know what is the default value of starting value in glm ? glm(..., start=c(),... ) I know that it is NULL by default but it need a value to start iteration . what is this value?

Re: [R] nlminb doesn't converge and produce a warning

2011-01-21 Thread Douglas Bates
On Fri, Jan 21, 2011 at 3:51 AM, kamel gaanoun kamel.gaan...@gmail.com wrote: Hi Everybody, My problem is that nlminb doesn't converge, in minimising a logLikelihood function, with 31*6 parameters(2 weibull parameters+29 regressors repeated 6 times). Hmm, the length of the parameter vector

Re: [R] speed up in R apply

2011-01-05 Thread Douglas Bates
On Wed, Jan 5, 2011 at 1:22 PM, David Winsemius dwinsem...@comcast.net wrote: On Jan 5, 2011, at 10:03 AM, Young Cho wrote: Hi, I am doing some simulations and found a bottle neck in my R script. I made an example: a = matrix(rnorm(500),100,5) tt  = Sys.time();

Re: [R] Proof for computing sums of squares

2011-01-03 Thread Douglas Bates
On Mon, Jan 3, 2011 at 12:15 PM, Ethan Arenson ethan.a.aren...@gmail.com wrote: Hi. I know that R computes sums of squares based on the diagonal of t(Q) %*% y %*% t(y) %*% Q, where Q comes from the QR-decomposition of the model matrix. So, how do you know that? When I look at the code for

Re: [R] How does R compute sums of squares?

2010-12-13 Thread Douglas Bates
On Mon, Dec 13, 2010 at 8:20 AM, Ethan Arenson ethan.a.aren...@gmail.com wrote: Consider the following missing data problem:  y = c(1, 2, 2, 2, 3) a = factor(c(1, 1, 1, 2, 2)) b = factor(c(1, 2, 3, 1, 2)) fit = lm(y ~ a + b) anova(fit)  Analysis of Variance Table Response: y          

Re: [R] problem on Matrix package~~

2010-12-09 Thread Douglas Bates
On Thu, Dec 9, 2010 at 5:37 AM, 朱曼 zhuman.priv...@gmail.com wrote: Hi,all! I encountered a problem not-yet-implemented method for list %*% dgCMatrix when I tried diagr %*% design_mat, where diagr-diag(vr,100), vr is a vector with 100 elements, and design_mat is a sparse matrix with dimension

Re: [R] Sparse matrix performance question

2010-12-07 Thread Douglas Bates
On Mon, Dec 6, 2010 at 1:11 PM, scott white distributedin...@gmail.com wrote: Btw, forgot to mention I am using the standard Matrix package and I am running version 2.10.1 of R. On Mon, Dec 6, 2010 at 11:04 AM, scott white distributedin...@gmail.comwrote: I have a very sparse square matrix

Re: [R] anova error

2010-12-01 Thread Douglas Bates
On Wed, Dec 1, 2010 at 9:02 AM, Ben Bolker bbol...@gmail.com wrote: Peter Ehlers ehlers at ucalgary.ca writes: It might be a good idea not to use an outdated version of R. I don't see your problem in R 2.12.0. Peter Ehlers On 2010-12-01 05:44, Jean.Coursol at math.u-psud.fr wrote:

Re: [R] how to do linear regression when dimension is high

2010-11-16 Thread Douglas Bates
On Tue, Nov 16, 2010 at 10:30 AM, poko2000 quan.poko2...@gmail.com wrote: Hi I am a newbie in R. I have data with dim of 20. How to use lm if i want to do regression with the whole design matrix? My y is the first column. the left are xs. Thanks a lot. Do you have the data stored in a

Re: [R] plot vs print ??

2010-11-16 Thread Douglas Bates
On Tue, Nov 16, 2010 at 11:09 AM, skan juanp...@gmail.com wrote: What's the differente betwen using plot and using print  in order to plot a graph? For example in order to plot the result of a histogram. Could you give an example? It seems that you are referring to graphics functions in

Re: [R] glmer, Error: Downdated X'X is not positive definite,49

2010-11-16 Thread Douglas Bates
It is often more effective to send questions about lmer or glmer to the r-sig-mixed-mod...@r-project.org mailing list, which I am cc:ing on this response. On Tue, Nov 16, 2010 at 3:25 AM, Annika annika.opperb...@jyu.fi wrote: Dear list, I am new to this list and I am new to the world of R.

Re: [R] Question about GLMER

2010-11-16 Thread Douglas Bates
I am cc:ing the r-sig-mixed-mod...@r-project.org mailing list on this reply as such questions are often answered more quickly on that list. On Tue, Nov 16, 2010 at 2:00 PM, Daniel Jeske daniel.je...@ucr.edu wrote: Dear R Help, I believe the glmer() function in lme4 automatically fits an

Re: [R] Integrate to 1? (gauss.quad)

2010-11-14 Thread Douglas Bates
I don't know about the statmod package and the gauss.quad function but generally the definition of Gauss-Hermite quadrature is with respect to the function that is multiplied by exp(-x^2) in the integrand. So your example would reduce to summing the weights. On Sun, Nov 14, 2010 at 11:18 AM,

Re: [R] Using R for Production - Discussion

2010-11-02 Thread Douglas Bates
On Mon, Nov 1, 2010 at 11:04 PM, Santosh Srinivas santosh.srini...@gmail.com wrote: Hello Group, This is an open-ended question. Quite fascinated by the things I can do and the control I have on my activities since I started using R. I basically have been using this for analytical related

Re: [R] Need help with lmer model specification syntax for nested mixed model

2010-10-31 Thread Douglas Bates
On Sun, Oct 31, 2010 at 2:35 AM, Carabiniero ja...@troutnut.com wrote: I haven't been able to fully make sense of the conflicting online information about whether and how to specify nesting structure for a nested, mixed model.  I'll describe my experiment and hopefully somebody who knows lme4

Re: [R] lme vs. lmer results

2010-10-26 Thread Douglas Bates
On Tue, Oct 26, 2010 at 12:27 PM, Dimitri Liakhovitski dimitri.liakhovit...@gmail.com wrote: Hello, and sorry for asking a question without the data - hope it can still be answered: I've run two things on the same data: # Using lme: mix.lme - lme(DV ~a+b+c+d+e+f+h+i, random = random = ~

Re: [R] Big data (over 2GB) and lmer

2010-10-23 Thread Douglas Bates
On Thu, Oct 21, 2010 at 2:00 PM, Ben Bolker bbol...@gmail.com wrote: Michal Figurski figurski at mail.med.upenn.edu writes: I have a data set of roughly 10 million records, 7 columns. It has only about 500MB as a csv, so it fits in the memory. It's painfully slow to do anything with it, but

Re: [R] how fit linear model with fixed slope?

2010-10-22 Thread Douglas Bates
On Fri, Oct 22, 2010 at 9:13 AM, Czerminski, Ryszard ryszard.czermin...@astrazeneca.com wrote: I want to fit a linear model with fixed slope e.g. y = x + b (instead of general: y = a*x + b) Is it possible to do with lm()? Yes. The simplest way is to fit lm(y - a*x ~ 1) which will give you

Re: [R] fast rowCumsums wanted for calculating the cdf

2010-10-15 Thread Douglas Bates
Although I know there is another message in this thread I am replying to this message to be able to include the whole discussion to this point. Gregor mentioned the possibility of extending the compiled code for cumsum so that it would handle the matrix case. The work by Dirk Eddelbuettel and

Re: [R] Odp: Object Browser

2010-09-28 Thread Douglas Bates
On Mon, Sep 27, 2010 at 3:04 AM, Petr PIKAL petr.pi...@precheza.cz wrote: Hi I noticed that nobody answered your question yet so here is my try. If you want to see what objects are in your environment you can use ls() but its output is only names of objects. Here is a function I use a long

Re: [R] lmer() vs. lme() gave different variance component estimates

2010-09-21 Thread Douglas Bates
I haven't had the time to keep up with this discussion, or many of the other discussions on the R-SIG-Mixed-Models email list. I swamped with other duties at present. It is important to remember that the nlme and lme4 packages take a model specification and provide code to evaluate the deviance.

Re: [R] lmer() vs. lme() gave different variance component estimates

2010-09-21 Thread Douglas Bates
On Tue, Sep 21, 2010 at 1:39 PM, Douglas Bates ba...@stat.wisc.edu wrote: I haven't had the time to keep up with this discussion, or many of the other discussions on the R-SIG-Mixed-Models email list.  I swamped with other duties at present. It is important to remember that the nlme and lme4

Re: [R] lmer() vs. lme() gave different variance component estimates

2010-09-21 Thread Douglas Bates
On Tue, Sep 21, 2010 at 4:21 PM, Peter Dalgaard pda...@gmail.com wrote: On 09/21/2010 09:02 PM, Douglas Bates wrote: On Tue, Sep 21, 2010 at 1:39 PM, Douglas Bates ba...@stat.wisc.edu wrote: I haven't had the time to keep up with this discussion, or many of the other discussions on the R-SIG

Re: [R] lapack in R 2.11.1 (Ubuntu 10.04.1)

2010-09-15 Thread Douglas Bates
On Wed, Sep 15, 2010 at 3:48 PM, Matias Salibian-Barrera msalib...@yahoo.ca wrote: Hi there, I'm trying to install the package RcppArmadillo in my R 2.11.1 which I installed and regularly update via Ubuntu's repositories. When I try to install RcppArmadillo from CRAN I get:

Re: [R] Help installation lme4a, Error Message: lme4a is not a valid installed library

2010-08-05 Thread Douglas Bates
On Thu, Aug 5, 2010 at 9:31 AM, rod84 ngueye...@hotmail.com wrote: Dear R users, I recently downloaded the library lme4a by svn checkout svn://svn.r-forge.r-project.org/svnroot/lme4. I tried to install the library lme4a by copying the downloaded document in the location where all the R

Re: [R] Passing the name of a variable to a function

2010-08-04 Thread Douglas Bates
On Wed, Aug 4, 2010 at 2:09 PM, Erik Iverson er...@ccbr.umn.edu wrote: Hello, I have a problem which has bitten me occasionally. I often need to prepare graphs for many variables in a data set, but seldom for all. or for any large number of sequential or sequentially named variables. Often

Re: [R] Matrix Size

2010-07-14 Thread Douglas Bates
On Wed, Jul 14, 2010 at 4:23 PM, paul s r-project@queuemail.com wrote: hi - i just started using R as i am trying to figure out how perform a linear regression on a huge matrix. i am sure this topic has passed through the email list before but could not find anything in the archives.

Re: [R] lme4

2010-07-06 Thread Douglas Bates
On OS X you need to install the source package for lme4 as the binary package fails one of the tests. We have been unable to reproduce this failure under other operating systems, which makes it hard to debug. On Tue, Jul 6, 2010 at 11:09 AM, Alex Foley alex_foley_...@yahoo.com wrote: Hi, I

Re: [R] Lattice and Beamer

2010-06-28 Thread Douglas Bates
On Mon, Jun 28, 2010 at 12:28 PM, Doran, Harold hdo...@air.org wrote: Two things I think are some of the best developments in statistics and production are the lattice package and the beamer class for presentation in Latex. One thing I have not become very good at is properly sizing my

Re: [R] how to efficiently compute set unique?

2010-06-21 Thread Douglas Bates
On Mon, Jun 21, 2010 at 8:38 PM, David Winsemius dwinsem...@comcast.net wrote: On Jun 21, 2010, at 9:18 PM, Duncan Murdoch wrote: On 21/06/2010 9:06 PM, G FANG wrote: Hi, I want to get the unique set from a large numeric k by 1 vector, k is in tens of millions when I used the matlab

Re: [R] Pretty printing progress

2010-06-17 Thread Douglas Bates
On Thu, Jun 17, 2010 at 10:50 AM, Barry Rowlingson b.rowling...@lancaster.ac.uk wrote: On Thu, Jun 17, 2010 at 3:33 PM, Doran, Harold hdo...@air.org wrote: I have a function that is an iterative process for estimating some MLEs. I want to print some progress to screen as the process iterates.

Re: [R] Compiling R with multi-threaded BLAS math libraries - why not actually ?

2010-06-12 Thread Douglas Bates
On Sat, Jun 12, 2010 at 6:18 AM, Tal Galili tal.gal...@gmail.com wrote: Hello Gabor, Matt, Dirk. Thank you all for clarifying the situation. So if I understand correctly then: 1) Changing the BLAST would require specific BLAST per computer configuration (OS/chipset). It's BLAS (Basic

Re: [R] Can one get a list of recommended packages?

2010-06-12 Thread Douglas Bates
On Sat, Jun 12, 2010 at 8:37 AM, Dr. David Kirkby david.kir...@onetel.net wrote: R 2.10.1 is used in the Sage maths project. Several recommended packages (Matrix, class, mgcv, nnet, rpart, spatial, and survival) are failing to build on Solaris 10 (SPARC). Have you checked the dependencies for

Re: [R] do faster ANOVAS

2010-06-10 Thread Douglas Bates
The lm and aov functions can take a matrix response allowing you to fit all of the responses for a single attribute simultaneously. On Thu, Jun 10, 2010 at 8:47 AM, melissa mellep...@orange.fr wrote: Dear all R users, I want to realize 800 000 ANOVAS and to store Sum of Squares of the effects.

Re: [R] glm output for binomial family

2010-06-08 Thread Douglas Bates
On Tue, Jun 8, 2010 at 7:10 AM, Enrico Colosimo enrico...@gmail.com wrote: Hello,  I am having some trouble running a very simple example. I am running a logistic regression entering the SAME data set in two different forms and getting different values for the deviance residual. Just look

Re: [R] sparse matrices in lme4

2010-05-24 Thread Douglas Bates
On Mon, May 24, 2010 at 6:24 PM, Robin Jeffries rjeffr...@ucla.edu wrote: I read somewhere (help list, documentation) that the random effects in lme4 uses sparse matrix technology. Yes. That is why there is such a close link between the Matrix and lme4 packages. The sparse matrix methods in

Re: [R] need help in understanding R code, and maybe some math

2010-05-23 Thread Douglas Bates
On Sun, May 23, 2010 at 5:09 AM, Peter Ehlers ehl...@ucalgary.ca wrote: On 2010-05-23 0:56, john smith wrote: Hi, I am trying to implement Higham's algorithm for correcting a non positive definite covariance matrix. I found this code in R:

Re: [R] Regression with sparse matricies

2010-05-23 Thread Douglas Bates
As Frank mentioned in his reply, expecting to estimate tens of thousands of fixed-effects parameters in a logistic regression is optimistic. You could start with a generalized linear mixed model instead library(lme4) fm1 - glmer(resp ~ 1 + (1|f1) + (1|f2) + (1|f1:f2), mydata, binomial)) If you

Re: [R] error in La.svd Lapack routine 'dgesdd'

2010-05-04 Thread Douglas Bates
Google the name dgesdd to get the documentation where you will find that the error code indicates that the SVD algorithm failed to converge. Evaluation of the singular values and vectors is done via an iterative optimization and on some occasions will fail to converge. Frequently this is

Re: [R] function which saves an image of a dgtMatrix as png

2010-04-28 Thread Douglas Bates
image applied to a sparseMatrix object uses lattice functions to create the image. As described in R FAQ 7.22 you must use print(image(x)) or show(image(x)) or even plot(image(x)) when a lattice function is called from within another function. On Wed, Apr 28, 2010 at 1:20 PM, Gildas Mazo

Re: [R] Evaluate variable

2010-04-09 Thread Douglas Bates
You probably want to use substitute() to construct your formula and be careful of the distinction between character strings and names substitute(foo ~ bar, list(foo = as.name(y), bar = as.name(x))) y ~ x On Fri, Apr 9, 2010 at 2:06 PM, Nic Rivers njriv...@sfu.ca wrote: Dear R-users: I would

Re: [R] I can´t run the example shown in the inline package

2010-04-08 Thread Douglas Bates
On Thu, Apr 8, 2010 at 11:32 AM, satu satu2...@live.com.ar wrote: I want to run some R script using the inline package (which allows to create and run inline C++ code in my humble understanding). So, after loading the required packages and copy and paste the example that runs C code (in the

Re: [R] SAS and R on multiple operating systems

2010-04-05 Thread Douglas Bates
On Mon, Apr 5, 2010 at 3:13 PM, Roger DeAngelis(xlr82sas) rdean...@amgen.com wrote: Hi, This is not meant to be critical of R, but is intended as a possible source for improvements to R. SAS needs the competition. I am reasonably knowledgeable about R SAS-(all products including IML)

Re: [R] large dataset

2010-03-29 Thread Douglas Bates
On Sat, Mar 27, 2010 at 4:19 AM, n.via...@libero.it n.via...@libero.it wrote: Hi I have a question, as im not able to import a csv file which contains a big dataset(100.000 records) someone knows how many records R can handle without giving problems? What im facing when i try to import the

[R] A file with extension .sdb in a codebook section of a large database from a survey?

2010-03-25 Thread Douglas Bates
The TIMSS2007 database http://timss.bc.edu/TIMSS2007/idb_ug.html seems to provide both kinds of universal data formats - either SPSS saved data sets or SAS saved data sets. (Yes, I am being sarcastic.) These, of course, are accompanied by massive codebooks explaining the nature of each of the

Re: [R] A file with extension .sdb in a codebook section of a large database from a survey?

2010-03-25 Thread Douglas Bates
Thanks very much, Marc. So did you really read 110 pages of the User Guide to find this out or did you do something more clever? On Thu, Mar 25, 2010 at 4:38 PM, Marc Schwartz marc_schwa...@me.com wrote: On Mar 25, 2010, at 3:54 PM, Douglas Bates wrote: The TIMSS2007 database http

Re: [R] no predict function in lme4 ?

2010-03-23 Thread Douglas Bates
It is not easy to decide what predict should return for a linear mixed model, let alone the more complicated cases. Do you want predictions based on the fixed-effects only or based on a combination of the fixed-effects and the random-effects? For the lme function in the nlme package we allowed

Re: [R] Using nlme and coxme (both!): Looking for workaround

2010-03-18 Thread Douglas Bates
On Thu, Mar 18, 2010 at 6:26 AM, Dieter Menne dieter.me...@menne-biomed.de wrote: I am trying to use nlme and coxme in one Sweave document. I have read the thread in r-devel on the subject, http://markmail.org/thread/snchg6ynofrzbf2v and nlme::fixef works, but I did not understand what

Re: [R] How good is R at making publication quality tables?

2010-03-17 Thread Douglas Bates
On Wed, Mar 17, 2010 at 10:25 AM, Erik Iverson er...@ccbr.umn.edu wrote: Paul Miller wrote: Hello Everyone, I have just started learning R and am in the process of figuring out what it can and can't do. I must say I am very impressed with R so far and am amazed that something this good

Re: [R] Nonparametric generalization of ANOVA

2010-03-05 Thread Douglas Bates
On Fri, Mar 5, 2010 at 12:16 PM, Gabor Grothendieck ggrothendi...@gmail.com wrote: On Fri, Mar 5, 2010 at 12:58 PM, Matthew Dowle mdo...@mdowle.plus.com wrote: As far as I know you are wrong that there is no moderator.  There are in fact an uncountable number of people who are empowered to

Re: [R] get problem

2010-02-24 Thread Douglas Bates
On Wed, Feb 24, 2010 at 3:56 PM, Duncan Murdoch murd...@stats.uwo.ca wrote: On 24/02/2010 4:31 PM, Georg Ehret wrote: Dear R communtiy,   I do not understand why this does not work...: betaS$SBP [1]  0.03274 -0.04216 -0.08986 -0.45980  0.60320 -0.63070 -0.05682  0.20130 t-c(betaS$SBP)

Re: [R] Print table in lme

2010-02-20 Thread Douglas Bates
On Sat, Feb 20, 2010 at 4:28 AM, Dieter Menne dieter.me...@menne-biomed.de wrote: Daniel-6 wrote: Hello, I'm trying to add lme results in a table with lm coef results, but as I know, estout or xtabel cannot  support lme objects. I'm a new in R and I'll appreciate some helpful comments.

Re: [R] Print table in lme

2010-02-20 Thread Douglas Bates
On Sat, Feb 20, 2010 at 10:27 AM, Dieter Menne dieter.me...@menne-biomed.de wrote: Douglas Bates-2 wrote: On Sat, Feb 20, 2010 at 4:28 AM, Dieter Menne For most other model fitting functions the sequence coef(summary(mymodel)) works.  Unfortunately, in the nlme package we assigned

Re: [R] Use of R in clinical trials

2010-02-18 Thread Douglas Bates
On Thu, Feb 18, 2010 at 12:36 PM, Bert Gunter gunter.ber...@gene.com wrote: The key dates are 1938 and 1962. The FDC act of 1938 essentially mandated (demonstration of) safety. The tox testing infrastructure grew from that.At that time, there were no computers, little data, little statistics

Re: [R] False convergence of a glmer model

2010-02-16 Thread Douglas Bates
On Tue, Feb 16, 2010 at 9:05 AM, Shige Song shiges...@gmail.com wrote: Dear All, I am trying to fit a 2-level random intercept logistic regression on a data set of 20,000 cases.  The model is specified as the following:  m1 - glmer(inftmort ~ as.factor(cohort) + (1|code), family=binomial,

Re: [R] lmer - error asMethod(object) : matrix is not symmetric

2010-02-16 Thread Douglas Bates
This is similar to another question on the list today. On Tue, Feb 16, 2010 at 4:39 AM, Luisa Carvalheiro lgcarvalhe...@gmail.com wrote: Dear R users, I  am having problems using package lme4. I am trying to analyse the effect of a continuous variable (Dist_NV) on a count data response

Re: [R] lmer - error asMethod(object) : matrix is not symmetric

2010-02-16 Thread Douglas Bates
, Luisa On Tue, Feb 16, 2010 at 5:35 PM, Douglas Bates ba...@stat.wisc.edu wrote: This is similar to another question on the list today. On Tue, Feb 16, 2010 at 4:39 AM, Luisa Carvalheiro lgcarvalhe...@gmail.com wrote: Dear R users, I  am having problems using package lme4. I am trying

Re: [R] False convergence of a glmer model

2010-02-16 Thread Douglas Bates
feel that I might get some very basic specification wrong in my R model... Best, Shige On Tue, Feb 16, 2010 at 10:29 AM, Douglas Bates ba...@stat.wisc.edu wrote: On Tue, Feb 16, 2010 at 9:05 AM, Shige Song shiges...@gmail.com wrote: Dear All, I am trying to fit a 2-level random intercept

Re: [R] lm function in R

2010-02-14 Thread Douglas Bates
On Sat, Feb 13, 2010 at 7:09 PM, Daniel Malter dan...@umd.edu wrote: It seems to me that your question is more about the econometrics than about R. Any introductory econometric textbook or compendium on econometrics will cover this as it is a basic. See, for example, Greene 2006 or Wooldridge

Re: [R] Why double quote is preferred?

2010-02-13 Thread Douglas Bates
On Fri, Feb 12, 2010 at 4:25 PM, blue sky bluesky...@gmail.com wrote: ?'`' shows the following: Single and double quotes delimit character constants. They can be used interchangeably but double quotes are *preferred* (and character constants are printed using double quotes), so single quotes

Re: [R] Potential problem with subset !!!

2010-02-12 Thread Douglas Bates
On Fri, Feb 12, 2010 at 9:22 AM, Arnaud Mosnier a.mosn...@gmail.com wrote: Dear useRs, Just a little post to provide the answer of a problem that took me some time to resolve ! Hope that reading this will permit the others to avoid that error. When using the subset function, writing

Re: [R] lmer

2010-02-09 Thread Douglas Bates
On Tue, Feb 9, 2010 at 4:38 AM, Demirtas, Hakan demir...@uic.edu wrote: Does lmer do three-level mixed-effects models? Yes. What forms of outcome variables can it handle (continuous, survival, binary)? I'd appreciate any help. Continuous outcomes for lmer. glmer can handle binary

Re: [R] Data views (Re: (Another) Bates fortune?)

2010-02-08 Thread Douglas Bates
On Sun, Feb 7, 2010 at 2:40 PM, Emmanuel Charpentier charp...@bacbuc.dyndns.org wrote: Note : this post has been motivated more by the hierarchical data subject than the aside joke of Douglas Bates, but might be of interest to its respondents. Le vendredi 05 février 2010 à 21:56 +0100, Peter

Re: [R] R-Help

2010-02-07 Thread Douglas Bates
On Sat, Feb 6, 2010 at 2:46 PM, David Winsemius dwinsem...@comcast.net wrote: On Feb 6, 2010, at 3:29 PM, Ravi Ramaswamy wrote: Hi - I am not familiar with R.  Could I ask you a quick question? When I read a file like this, I get an error.  Not sure what I am doing wrong.  I use a MAC.  How

Re: [R] lmer Error message

2010-02-06 Thread Douglas Bates
On Sat, Feb 6, 2010 at 4:45 AM, Martin Bulla bu...@centrum.cz wrote: Does anybody knows what this error message means: Error in object$terms : $ operator not defined for this S4 class The error message means what it says and it doesn't come from lmer, it comes from the drop1 function being

Re: [R] Hierarchical data sets: which software to use?

2010-02-05 Thread Douglas Bates
On Sun, Jan 31, 2010 at 10:24 PM, Anton du Toit atdutoitrh...@gmail.com wrote: Dear R-helpers, I’m writing for advice on whether I should use R or a different package or language. I’ve looked through the R-help archives, some manuals, and some other sites as well, and I haven’t done too well

Re: [R] Symmetric Matrix classes

2010-01-19 Thread Douglas Bates
On Tue, Jan 19, 2010 at 9:26 AM, Martin Maechler maech...@stat.math.ethz.ch wrote: Scanning for 'Matrix' in old R-help e-mail, I found GA == Gad Abraham gabra...@csse.unimelb.edu.au     on Fri, 27 Nov 2009 13:45:00 +1100 writes:    GA Hi,    GA I'd like to store large covariance matrices

Re: [R] Hierarchical Linear Model using lme4's lmer

2010-01-16 Thread Douglas Bates
On Sat, Jan 16, 2010 at 8:20 AM, Walmes Zeviani walmeszevi...@hotmail.com wrote: Doug, It appears you are mixing nlme and lme4 formulation type. On nlme library you type lme(y~x, random=~1|subjetc) On lme4 library you type lmer(y~x+(1|subject)) You mixed them. At your disposal.

Re: [R] advice/opinion on quot; lt; -quot; vs quot; =quot; in teaching R

2010-01-15 Thread Douglas Bates
On Fri, Jan 15, 2010 at 10:00 AM, Ben Bolker bol...@ufl.edu wrote: John Kane jrkrideau at yahoo.ca writes: I've only been using R for about 2.5 years but and I'm not all that good  but I vote for - . I think the deciding factor is in  RSiteSearch() and the various manuals. Almost

Re: [R] Piecewise regression in lmer

2010-01-04 Thread Douglas Bates
On Mon, Jan 4, 2010 at 6:24 AM, Walmes Zeviani walmeszevi...@hotmail.com wrote: AD Hayward wrote: Dear all, I'm attempting to use a piecewise regression to model the trajectory of reproductive traits with age in a longitudinal data set using a mixed model framework. The aim is to find

[R] Fwd: glm error: cannot correct step size

2009-12-30 Thread Douglas Bates
I forgot to cc: the list on this response. -- Forwarded message -- From: Douglas Bates ba...@stat.wisc.edu Date: Wed, Dec 30, 2009 at 8:05 AM Subject: Re: [R] glm error: cannot correct step size To: John Sorkin jsor...@grecc.umaryland.edu On Wed, Dec 30, 2009 at 7:50 AM, John

  1   2   3   >