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 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 what should be

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 matr

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 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 R in the published >

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 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) >> m1<-Matrix(rep(1,4),nrow=2,ncol=2,s

Re: [R] Getting codebook data into R

2012-02-09 Thread Douglas Bates
On Thu, Feb 9, 2012 at 2:51 PM, barny 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 into > the codebook and wha

Re: [R] regarding QRb() function

2011-12-28 Thread Douglas Bates
2011/12/28 Uwe Ligges : > > > 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 >> X<-subset(data,select=c(V1,V2,V3,V4,

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 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 <- >> > spMatrix(nrow=5,ncol

Re: [R] MIXED MODEL WITH REPEATED MEASURES

2011-12-07 Thread Douglas Bates
On Dec 7, 2011 4:44 PM, "Erin Ryan" 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 > trying to do. I'

Re: [R] S4 vs Reference Classes

2011-09-13 Thread Douglas Bates
On Tue, Sep 13, 2011 at 4:11 PM, Steve Lianoglou wrote: > Hi, > > On Tue, Sep 13, 2011 at 1:54 PM, Joseph Park 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

Re: [R] S4 vs Reference Classes

2011-09-13 Thread Douglas Bates
On Tue, Sep 13, 2011 at 12:54 PM, Joseph Park 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 that was the

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 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?) Ubuntu and / or R.

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 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 analysis s

Re: [R] Matrix package transpose

2011-04-20 Thread Douglas Bates
On Wed, Apr 20, 2011 at 8:37 AM, Tobias Abenius 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 from the > Matrix package

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 wrote: > Kevin Wright 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 Treatme

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 wrote: > On Thu, Apr 14, 2011 at 7:02 PM, > 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 >> I could do in R.  I don't have the script o

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

2011-04-14 Thread Douglas Bates
mber that there is a findInterval function. > From: r-help-boun...@r-project.org [r-help-boun...@r-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

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] 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 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 records look like > t

Re: [R] converting "call" objects into character

2011-04-03 Thread Douglas Bates
On Sun, Apr 3, 2011 at 11:42 AM, David Winsemius 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 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 combinations. Therefore nls > fails and so

Re: [R] string interpolation

2011-03-21 Thread Douglas Bates
On Mon, Mar 21, 2011 at 2:03 PM, Justin Haynes 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 column id but ra

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 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 = unique(mydata$id)

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 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 the net. I have been

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 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 collects the data with >

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 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 in R (Newt

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

2011-02-05 Thread Douglas Bates
On Fri, Feb 4, 2011 at 8:44 PM, Laura Smith 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 phrase "calculati

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 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 > distribution. I rea

Re: [R] Measure execution time

2011-01-27 Thread Douglas Bates
?system.time On Thu, Jan 27, 2011 at 10:31 AM, Alaios 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 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? Actually the typical

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 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 shown below is 189,

Re: [R] speed up in R apply

2011-01-05 Thread Douglas Bates
On Wed, Jan 5, 2011 at 1:22 PM, David Winsemius 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(); sum(a[,1]*a[,2]*a[,3]*

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 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 summary.lm I see t

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 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 >          Df  Sum Sq Mean

Re: [R] problem on Matrix package~~

2010-12-09 Thread Douglas Bates
On Thu, Dec 9, 2010 at 5:37 AM, 朱曼 wrote: > Hi,all! > I encountered a problem "not-yet-implemented method for %*% > " 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 100*677000 constructed by

Re: [R] Sparse matrix performance question

2010-12-07 Thread Douglas Bates
On Mon, Dec 6, 2010 at 1:11 PM, scott white 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 > wrote: > >> I have a very sparse square matrix which is < 20K rows & columns and I am >> tr

Re: [R] anova error

2010-12-01 Thread Douglas Bates
On Wed, Dec 1, 2010 at 9:02 AM, Ben Bolker wrote: > > > Peter Ehlers 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 math.u-psud.fr wrote: >> > Just for

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 wrote: > Dear R Help, > I believe the glmer() function in lme4 automatically fits an > unstrucruted covariance

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 wrote: > > Dear list, > > I am new to this list and I am new to the world of R. Additionally I am not

Re: [R] plot vs print ??

2010-11-16 Thread Douglas Bates
On Tue, Nov 16, 2010 at 11:09 AM, skan 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 packages such as

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 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 matrix or in a data fr

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, Dora

Re: [R] Using R for Production - Discussion

2010-11-02 Thread Douglas Bates
On Mon, Nov 1, 2010 at 11:04 PM, Santosh Srinivas 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 work off my desktop.

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 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 > well can help

Re: [R] lme vs. lmer results

2010-10-26 Thread Douglas Bates
On Tue, Oct 26, 2010 at 12:27 PM, Dimitri Liakhovitski 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 = ~ e+f+h+i| > group, data = m

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 wrote: > Michal Figurski 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 it's possible. I also

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 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 the estimate of b, its standard

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 Rom

Re: [R] Odp: Object Browser

2010-09-28 Thread Douglas Bates
On Mon, Sep 27, 2010 at 3:04 AM, Petr PIKAL 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 > time for checking

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 wrote: > On 09/21/2010 09:02 PM, Douglas Bates wrote: >> On Tue, Sep 21, 2010 at 1:39 PM, Douglas Bates wrote: >>> I haven't had the time to keep up with this discussion, or many of the >>> other discussions on the R

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 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 an

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] 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 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: > >> install.packages('Rc

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 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 libraries are saved.

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 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 I need s

Re: [R] Matrix Size

2010-07-14 Thread Douglas Bates
On Wed, Jul 14, 2010 at 4:23 PM, paul s 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. > i have a matrix that i

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 wrote: > Hi, > > I was trying to install l

Re: [R] Lattice and Beamer

2010-06-28 Thread Douglas Bates
On Mon, Jun 28, 2010 at 12:28 PM, Doran, Harold 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 visuals > to look

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 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 wrote: > On Thu, Jun 17, 2010 at 3:33 PM, Doran, Harold 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. I would like >> to try and line thing

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 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 those packages? Some

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 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 Linear Algebra Subr

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 wrote: > Dear all R users, > I want to realize 800 000 ANOVAS and to store Sum of Squares of the effects. > Here is an ext

Re: [R] glm output for binomial family

2010-06-08 Thread Douglas Bates
On Tue, Jun 8, 2010 at 7:10 AM, Enrico Colosimo 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 with this naive

Re: [R] sparse matrices in lme4

2010-05-24 Thread Douglas Bates
On Mon, May 24, 2010 at 6:24 PM, Robin Jeffries 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 the Matrix packa

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] 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 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: >> >> http://projects.cs.kent.ac.uk/projects/cxxr/trac/brows

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 related

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 wr

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 wrote: > Dear R-users: > > I would like to

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 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 Reference Manual a

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) 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) > > SAS

Re: [R] large dataset

2010-03-29 Thread Douglas Bates
On Sat, Mar 27, 2010 at 4:19 AM, 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 file is that R ge

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 wrote: > On Mar 25, 2010, at 3:54 PM, Douglas Bates wrote: > >> The TIMSS2007 database http://timss.bc.e

[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 fi

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 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 workaround to use when > I a

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 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 can ac

Re: [R] Nonparametric generalization of ANOVA

2010-03-05 Thread Douglas Bates
On Fri, Mar 5, 2010 at 12:16 PM, Gabor Grothendieck wrote: > On Fri, Mar 5, 2010 at 12:58 PM, Matthew Dowle 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 moderate i.e. all >> of us. In other words it

Re: [R] "get" problem

2010-02-24 Thread Douglas Bates
On Wed, Feb 24, 2010 at 3:56 PM, Duncan Murdoch 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] env() for lme4

2010-02-23 Thread Douglas Bates
On Tue, Feb 23, 2010 at 2:17 AM, Dieter Menne wrote: > Marianne Promberger-3 wrote: >> >> Yes, I believe you need library(lme4a), the development version of lme4. >> >> >> (But then something didn't work with profile() on my particular model >> but I forgot what it was -- haven't had time to

Re: [R] Print table in lme

2010-02-20 Thread Douglas Bates
On Sat, Feb 20, 2010 at 10:27 AM, Dieter Menne 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.  Unfortunate

Re: [R] Print table in lme

2010-02-20 Thread Douglas Bates
On Sat, Feb 20, 2010 at 4:28 AM, Dieter Menne 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. >> > > I don't know

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 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 > methodology. Statist

Re: [R] False convergence of a glmer model

2010-02-16 Thread Douglas Bates
--- > Likelihood-ratio test of rho=0: chibar2(01) =   109.20 Prob >= chibar2 = 0.000 > > The difference is quite huge, and Stata did not have any difficulties > estimating this model, which makes feel that I might get some very > basic specification wr

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

2010-02-16 Thread Douglas Bates
0.22 in the call to lmer. > Does this information helps identifying the problem with my data/analysis? > > Thank you, > > Luisa > > > > > On Tue, Feb 16, 2010 at 5:35 PM, Douglas Bates wrote: >> This is similar to another question on the list today. >> >> On

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 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 variable (SR_SUN) usin

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 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, data=d) > I got

Re: [R] lm function in R

2010-02-14 Thread Douglas Bates
On Sat, Feb 13, 2010 at 7:09 PM, Daniel Malter 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 > 2002. > > S

Re: [R] Why double quote is preferred?

2010-02-13 Thread Douglas Bates
On Fri, Feb 12, 2010 at 4:25 PM, blue sky 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 are > normally

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

2010-02-12 Thread Douglas Bates
On Fri, Feb 12, 2010 at 9:22 AM, Arnaud Mosnier 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 > > subset (data, da

Re: [R] lmer

2010-02-09 Thread Douglas Bates
On Tue, Feb 9, 2010 at 4:38 AM, Demirtas, Hakan 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 outcomes. __

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 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 +010

Re: [R] R-Help

2010-02-07 Thread Douglas Bates
On Sat, Feb 6, 2010 at 2:46 PM, David Winsemius 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 do I specif

Re: [R] lmer Error message

2010-02-06 Thread Douglas Bates
On Sat, Feb 6, 2010 at 4:45 AM, Martin Bulla 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 applied to a model

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 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 finding relevant in

Re: [R] Symmetric Matrix classes

2010-01-19 Thread Douglas Bates
On Tue, Jan 19, 2010 at 9:26 AM, Martin Maechler wrote: > Scanning for 'Matrix' in old R-help e-mail, I found > >> "GA" == Gad Abraham >>     on Fri, 27 Nov 2009 13:45:00 +1100 writes: > >    GA> Hi, >    GA> I'd like to store large covariance matrices using Matrix classes. > >    GA> dsy

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 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. Which is what

Re: [R] advice/opinion on " < -" vs " =" in teaching R

2010-01-15 Thread Douglas Bates
On Fri, Jan 15, 2010 at 10:00 AM, Ben Bolker wrote: > John Kane 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 everything I see u

Re: [R] lme4 and function 'cholmod_start' not provided by package 'Matrix' / Ubuntu

2010-01-10 Thread Douglas Bates
As Dieter points out, this is likely a mismatch between the versions of the lme4 and the Matrix packages, which are very closely linked together. It appears that the version of the lme4 package is too old for the version of the Matrix package, which is hard to catch in the dependencies (lme4 depen

  1   2   3   4   >