Re: [R] Error when running Conditional Logit Model

2009-12-18 Thread tlumley
On Fri, 18 Dec 2009, Hien Nguyen wrote: Dear Drs Winsemius and Berry, Thanks a lot for your comment and suggestions on running my model. I am not just new to R but new to CLM as well. :( With your suggestions, I figure out that I have huge misunderstandings on the model and data arrangement.

Re: [R] Baseline survival estimate

2009-12-16 Thread tlumley
survival = exp(-hazard) -thomas On Wed, 16 Dec 2009, Laura Bonnett wrote: Dear R-help, I am trying to obtain the baseline survival estimate of a fitted Cox model (S_0 (t)). I know that previous posts have said use 'basehaz' but this gives the baseline hazard function and not the

Re: [R] Is there lazy copy in R?

2009-12-15 Thread tlumley
On Wed, 16 Dec 2009, Peng Yu wrote: On Tue, Dec 15, 2009 at 10:32 PM, hadley wickham h.wick...@gmail.com wrote: I don't understand what these addresses mean. Would you please help me understand it? Did you try reading the documentation?     When an object is traced any copying of the object

Re: [R] Is there lazy copy in R?

2009-12-15 Thread tlumley
On Tue, 15 Dec 2009, Peng Yu wrote: 2009/12/15 tlum...@u.washington.edu: On Wed, 16 Dec 2009, Peng Yu wrote: On Tue, Dec 15, 2009 at 10:32 PM, hadley wickham h.wick...@gmail.com wrote: I don't understand what these addresses mean. Would you please help me understand it? Did you try

Re: [R] LINEAR MIXED EFFECT

2009-11-13 Thread tlumley
On Fri, 13 Nov 2009, milton ruser wrote: Hi Ana, you did again :-) require(fortunes) fortune(dog) Firstly, don't call your matrix 'matrix'. Would you call your dog 'dog'? Anyway, it might clash with the function 'matrix'. -- Barry Rowlingson R-help (October 2004) if you call your data

Re: [R] naive collinear weighted linear regression

2009-11-13 Thread tlumley
On Wed, 11 Nov 2009, David Winsemius wrote: On Nov 11, 2009, at 7:45 PM, Mauricio Calvao wrote: When I try: fit_mod - lm(y~x,weights=1/error^2) I get Warning message: In lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) : extra arguments weigths are just disregarded.

Re: [R] Is there a way to specify drop=FALSE as the global default?

2009-11-11 Thread tlumley
On Wed, 11 Nov 2009, Peng Yu wrote: On Mon, Oct 19, 2009 at 7:57 PM, Peng Yu pengyu...@gmail.com wrote: tmp - matrix(1:2) tmp tmp[,1,drop=FALSE] See the above example. Is there a way to make 'drop=FALSE' as global default, so that when I say 'tmp[,1]', R will treat it as

Re: [R] Error: cannot allocate vector of size...

2009-11-11 Thread tlumley
On Wed, 11 Nov 2009, Larry Hotchkiss wrote: Hi, I'm responding to the question about storage error, trying to read a 300 x 100 dataset into a data.frame. I wonder whether you can read the data as strings. If the numbers are all one digit, each cell would require just 1 byte instead of

Re: [R] Error: cannot allocate vector of size...

2009-11-10 Thread tlumley
On Tue, 10 Nov 2009, maiya wrote: OK, it's the simple math that's confusing me :) So you're saying 2.4GB, while windows sees the data as 700KB. Why is that different? Your data are stored on disk as a text file (in CSV format, in fact), not as numbers. This can take up less space. And

Re: [R] when vectorising does not work: silent function fail?

2009-11-10 Thread tlumley
On Tue, 10 Nov 2009, jim holtman wrote: Have you tried something like this: my.results = apply(chr, 2, function(x){ result - try(anova(lrm( cpstc.f ~ x + time.cpstc + age + sex + mri))[1,3]) if (inherits(result, try-error)) return(NULL) result }) This should catch the error and have

Re: [R] NetCDF output in R

2009-11-10 Thread tlumley
On Tue, 10 Nov 2009, nana wrote: I will be glad if someone can point out what I am doing wrong or not doing at all in this. Sending the same message to both r-help and r-devel is one thing you are doing wrong. I am trying to write out netcdf file in R. I have 26 time step but only the

Re: [R] Dates plotting backwards

2009-11-10 Thread tlumley
On Tue, 10 Nov 2009, Sam Albers wrote: Hello, I am having a little trouble formatting my dates correctly. When I plot something using the following commands, R plots the most recent date on the left of the figure and then earlier date on the right of the figure. Given that English is read from

Re: [R] object not found within function

2009-11-03 Thread tlumley
On Mon, 2 Nov 2009, Thushyanthan Baskaran wrote: Hi, I am trying to write a function to compute many cross-tabulations with the -svytable- command. Here is a simplified example of the structure of my code (adapted from the -svytable- help file): In the 'survey' package -- if you say what

Re: [R] Memory Problems with CSV and Survey Objects

2009-10-25 Thread tlumley
memory.size() [1] 1449.06 gc() used (Mb) gc trigger (Mb) max used (Mb) Ncells 131148 3.6 593642 15.9 15680924 418.8 Vcells 45479988 347.0 173526492 1324.0 220358611 1681.3 A description of the survey package can be found here: http://faculty.washington.edu/tlumley/survey

Re: [R] NULL elements in lists ... a nightmare

2009-10-25 Thread tlumley
It is perhaps also worth mentioning that this is the very first question in the actual R questions section of the R FAQ. 7.1 How can I set components of a list to NULL? You can use x[i] - list(NULL) to set component i of the list x to NULL, similarly for named components. Do not set

Re: [R] coxph() and survfit()

2009-10-23 Thread tlumley
On Thu, 22 Oct 2009, Mura Tamakou wrote: Dear All, I have a question regarding the output of survfit() when I supply a Cox model. Lets say for example: snipped: code that doesn't quite run we observe that the 95% CIs overlap!! How is this possible since the HR for spiders is significant.

Re: [R] Memory Problems with CSV and Survey Objects

2009-10-23 Thread tlumley
() [1] 1449.06 gc() used (Mb) gc trigger (Mb) max used (Mb) Ncells 131148 3.6 593642 15.9 15680924 418.8 Vcells 45479988 347.0 173526492 1324.0 220358611 1681.3 A description of the survey package can be found here: http://faculty.washington.edu/tlumley/survey/ I tried

Re: [R] Weighted Logistic Regressions using svyglm

2009-10-20 Thread tlumley
On Mon, 19 Oct 2009, Fulton wrote: I’m running some logistic regressions and I’ve been trying to include weights in the equation. However, when I run the model, I get this warning message: Here’s what it says: Warning message: In eval(expr, envir, enclos) : non-integer #successes in a

Re: [R] How to import the large data into R

2009-10-19 Thread tlumley
On Mon, 19 Oct 2009, Jun Chen wrote: Dear, I would like to deal with microarray data, it can run when i deal with little data. However, the amount number of SNP data are 45181, amount numbers of animal are 3081,it can not be allocated 1000Mb memory when i importing them to R Procedure sentence