Re: [R] exact conditional mantelhaen.test estimate is 0 ?!

2005-07-08 Thread Thomas Lumley
On Fri, 8 Jul 2005, Florian Hahne wrote: Dear listers, I am trying to compute the exact conditional test given strata margins of a 2 by 2 by K array using the mantelhaen.test function to get a common odds ratio estimate. The estimate for the test on the following data is 0, which in my

Re: [R] plot(cox.zph()): customize xlab ylab

2005-07-11 Thread Thomas Lumley
On Mon, 11 Jul 2005, Adaikalavan Ramasamy wrote: I am not sure if there is an easy way around this. An ugly hack is to make a copy the function survival:::plot.cox.zph and make your modified function. But there are others in the list who might know neater solutions. If you then send a patch

Re: [R] write.foreign, SPSS on Mac OS X

2005-07-13 Thread Thomas Lumley
On Wed, 13 Jul 2005, EJ Nikelski wrote: Your suggestion that the unprintable characters represent UTF-8 encoded Unicode left and right double quotes also appears correct. Now, although the suggested work-around may well help, the foreign package does seem to be creating a corrupted file. That

Re: [R] memory problem

2005-07-14 Thread Thomas Lumley
On Thu, 14 Jul 2005, Duncan Murdoch wrote: On 7/14/2005 7:19 AM, Ginters wrote: Why does memory need so much (1.6 GB) space? How can I enlarge it? Is it possible to allocate a part of memory used to the hard drive? Or, is the trouble only with my script? This sounds like a problem with the

[R] DSC 2005 registration

2005-07-14 Thread Thomas Lumley
/dsc2005/program.html -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

Re: [R] Coxph with factors

2005-07-15 Thread Thomas Lumley
On Fri, 15 Jul 2005, Kylie-Anne Richards wrote: FIRST Q: The default uses the mean of 'vo' and mean of 'po', but what is it using for the factors?? Is it the sum of the coef of the factors divided by the number of factors?? It uses the mean of each factor variable. The $means component of

Re: [R] Can't get sample function from An Introduction to R to work

2005-07-16 Thread Thomas Lumley
On Fri, 15 Jul 2005, David Groos wrote: Thank you-all very much for your help, your responses and help has been very encouraging. The following doesn't close the case but it tables it... First I copied Ken's code into my R Console and...it worked great! That was baffling as it looked

Re: [R] Coxph with factors

2005-07-16 Thread Thomas Lumley
On Sat, 16 Jul 2005, Kylie-Anne Richards wrote: Thank you for your help. In any case, to specify f.pom You need it to be a factor with the same set of levels. You don't say what the lowest level of pom is, but if it is, say, -3.

Re: [R] R: to the power

2005-07-16 Thread Thomas Lumley
On Sat, 16 Jul 2005, Bernardo Rangel Tura wrote: At 10:11 12/7/2005, [EMAIL PROTECTED] wrote: hi all why does R do this: (-8)^(1/3)=NaN the answer should be : -2 Yes and no. The problem is that the reciprocal of 3 is not exactly representable as a floating point number (it has an

Re: [R] Coxph with factors

2005-07-16 Thread Thomas Lumley
On Sat, 16 Jul 2005, Thomas Lumley wrote: Yes, but you don't need to go via the baseline. The survival curves for any two covariate vectors z1 and z2 are related by S(t; z1)= S(t; z2)^(z1-z2) Actually S(t; z1)=S(t;z2) ^(beta'(z1-z2)) of course. -thomas

Re: [R] read large amount of data

2005-07-18 Thread Thomas Lumley
On Mon, 18 Jul 2005, Weiwei Shi wrote: Hi, I have a dataset with 2194651x135, in which all the numbers are 0,1,2, and is bar-delimited. I used the following approach which can handle 100,000 lines: t-scan('fv', sep='|', nlines=10) t1-matrix(t, nrow=135, ncol=10) t2-t(t1)

Re: [R] R: expression

2005-07-19 Thread Thomas Lumley
one do this? legend(-5, .3, substitute(hat(phi) == PHI, list(PHI = PHI))) or legend(-5, .3, bquote(hat(phi) == .(PHI))) -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle

Re: [R] Clustered standard errors in a panel

2005-07-21 Thread Thomas Lumley
://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle __ R-help

Re: [R] output of variance estimate of random effect from a gamma frailty model using Coxph in R

2005-07-21 Thread Thomas Lumley
On Thu, 21 Jul 2005 [EMAIL PROTECTED] wrote: Hi, I have a question about the output for variance of random effect from a gamma frailty model using coxph in R. Is it the vairance of frailties themselves or variance of log frailties? Thanks. For a Gamma frailty model it is the variance of

Re: [R] Question about 'text' (add lm summary to a plot)

2005-07-22 Thread Thomas Lumley
On Fri, 22 Jul 2005, Dan Bolser wrote: On Fri, 22 Jul 2005, Gabor Grothendieck wrote: Try as.expression(bquote(...whatever...)) Sob, wimper, etc. a-7 plot(1) legend(topleft,legend=do.call(expression, list(bquote(alpha==.(a)),bquote(alpha^2+1==.(a^2+1)

Re: [R] Question about 'text' (add lm summary to a plot)

2005-07-22 Thread Thomas Lumley
On Fri, 22 Jul 2005, Gabor Grothendieck wrote: I think legend accepts a list argument directly so that could be simplified to just: a-7 plot(1) L - list(bquote(alpha==.(a)),bquote(alpha^2+1==.(a^2+1))) legend(topleft,legend=L) Except that it wouldn't then work: the mathematical stuff

Re: [R] Mean and variance of the right-censored data

2005-07-25 Thread Thomas Lumley
On Mon, 25 Jul 2005, Petr Mandys wrote: Thank you! I'm using this: require(NADA) var_sf=survfit(Surv(a, !b)) var_result=new(cenfit, survfit=var_sf) Class cenfit has methods to get mean a variance from survfit result. Is this correct? NADA is designed for left censoring. I don't know

Re: [R] Don't understand plotmath behaviour (bug?)

2005-07-25 Thread Thomas Lumley
On Mon, 25 Jul 2005, Wladimir Eremeev wrote: Hello, all Please, consider the following pieces of code. 1. v-0.5 text(x=2,y=2,eval(substitute(expression(bold(S==V)),list(V=formatC(v,format=f,digits=2) This plots S=0.5 in bold. Both S and 0.5 are bold. 2. v-0.5

Re: [R] Difficulty getting standard deviation of ALL odds ratios with glm function, logistic regression, need cov of parameters

2005-07-26 Thread Thomas Lumley
On Tue, 26 Jul 2005, Garrett Fox wrote: I am trying to do logistic regression with a categorical predictor variable with the glm() function, family=binomial. Using glm() I would like to be able to calculate the confidence intervals of all three possible odds ratios for a factor (the factor

Re: [R] spss.read factor reversal

2005-07-27 Thread Thomas Lumley
On Wed, 27 Jul 2005, Peter Dalgaard wrote: Adaikalavan Ramasamy [EMAIL PROTECTED] writes: I think it is doing what is supposed to do but I never used read.spss, so take this with a pinch of salt. In R when you use as.integer on a factor, the one with the lowest level gets a value of 1 and

Re: [R] Redirecting Messages and Errors to a file

2005-07-27 Thread Thomas Lumley
On Wed, 27 Jul 2005, McGehee, Robert wrote: However, the sink() does not seem to be capturing the error messages as I would have hoped. That is, if the R-script is {print(abc); stop(def)}, the print output is captured to the file, the stop error message is not, and instead sent to the

Re: [R] problem with an IF statement?

2005-07-28 Thread Thomas Lumley
-guide.html Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Binary outcome with non-absorbing outcome state

2005-07-29 Thread Thomas Lumley
On Fri, 29 Jul 2005, John Sorkin wrote: I am trying to model data in which subjects are followed through time to determine if they fall, or do not fall. Some of the subjects fall once, some fall several times. Follow-up time varies from subject to subject. I know how to model time to the

Re: [R] Binary outcome with non-absorbing outcome state

2005-07-29 Thread Thomas Lumley
On Fri, 29 Jul 2005, Dieter Menne wrote: John Sorkin jsorkin at grecc.umaryland.edu writes: I am trying to model data in which subjects are followed through time to determine if they fall, or do not fall. Some of the subjects fall once, some fall several times. Follow-up time varies from

Re: [R] converting stata's by syntax to R

2005-08-01 Thread Thomas Lumley
On Mon, 1 Aug 2005, Chris Wallace wrote: I am struggling with migrating some stata code to R. I have a data frame containing, sometimes, repeat observations (rows) of the same family. I want to keep only one observation per family, selecting that observation according to some other

Re: [R] can we manage memory usage to increase speed?

2005-08-02 Thread Thomas Lumley
-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle

Re: [R] Converting a list from R to Stata

2005-08-03 Thread Thomas Lumley
On Wed, 3 Aug 2005, Vicky Landsman wrote: Dear all, I have a list containing 150 simulated datasets in R. Is there a way to convert it to the Stata format such that I will be able to apply some Stata functions on each dataset in the list? For Stata your best best is probably to stack all

Re: [R] color palette

2005-08-03 Thread Thomas Lumley
On Wed, 3 Aug 2005, array chip wrote: Hi, I have a matrix with both positive and negative numbers, I would like to use image() to draw a heatmap. How can I can design a palette (or is there a function already available) that treat negative numbers in a blue gradient and positive numbers in a

Re: [R] An small suggestion for the R team

2005-08-04 Thread Thomas Lumley
On Thu, 4 Aug 2005, Jose Claudio Faria wrote: I would like to suggest that all R functions/etc like: codes-deprecated grid-internal ns-alt ns-dblcolon ns-hooks ns-internals ns-lowlev ns-reflect.Rd tools-internal ts-defunct utils-deprecated utils-internal ... and another

Re: [R] Avoiding for loop

2005-08-04 Thread Thomas Lumley
On Thu, 4 Aug 2005, Matt Crawford wrote: I understand that in R, for loops are not used as often as other languages, and am trying to learn how to avoid them. I am wondering if there is a more efficient way to write a certain piece of code, which right now I can only envision as a for loop.

[R] GUIs (was Re: make error: X11/Intrinsic.h: No such,,,)

2005-08-08 Thread Thomas Lumley
On Mon, 8 Aug 2005, Jake Michaelson wrote: I use Mac OS X at home and Linux at work, so the R Aqua GUI has spoiled me. I have not seen its equal so far (on Windows or Linux). The most important thing to me is how easily accessible the help and documentation is. I like how when I begin

Re: [R] clip to keep coordinate system?

2005-08-09 Thread Thomas Lumley
On Tue, 9 Aug 2005 [EMAIL PROTECTED] wrote: dear R wizards: plot( 1, 1, ylim=(2,10), xlim=(2,10), type=n); rect( -1, -1, 12, 12, col=gray(0.99) ); unfortunately wipes out the border axes around the plot. how do I keep this? I think you meant plot( 1, 1, ylim=c(2,10), xlim=c(2,10),

Re: [R] Exponential, Weibull and log-logistic distributions in glm()

2005-08-10 Thread Thomas Lumley
On Wed, 10 Aug 2005, Gorjanc Gregor wrote: Dear R-users! I would like to fit exponential, Weibull and log-logistic via glm() like functions. Does anyone know a way to do this? Bellow is a bit longer description of my problem. I think you want to use survreg(). It will still work when there

Re: [R] sub set selection

2005-08-11 Thread Thomas Lumley
On Thu, 11 Aug 2005, Clark Allan wrote: hi all is there a package that undertakes subset selection but BASED ON AIC or any other information criteria. i've seen the subselect and the leaps package but i have not played around with them yet. The leaps package finds a best model of each

Re: [R] Creating new columns inside a loop

2005-08-11 Thread Thomas Lumley
-- --- David L. Van Brunt, Ph.D. mailto:[EMAIL PROTECTED] [[alternative HTML version deleted]] Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington

Re: [R] Converting strings with internal delimiters into lists

2005-08-11 Thread Thomas Lumley
/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle __ R-help@stat.math.ethz.ch mailing

Re: [R] boot error: Error in statistic(data, original, ...) : unused argument(s) ( ...)

2005-08-15 Thread Thomas Lumley
On Sat, 13 Aug 2005, Prof Brian Ripley wrote: I suspect you want AdjForBase2 - function (data, inds) and to refer to data[inds, 1] and data[inds, 2], but since your code is completely devoid of spaces and indentation, I have paid it little attention.

Re: [R] paste / system mystery

2005-08-15 Thread Thomas Lumley
On Mon, 15 Aug 2005 [EMAIL PROTECTED] wrote: Dear R wizards: under R-2.1.0: eargs - 3:5; line - paste(c(echo A B, eargs)); cat(executing from R: ', line, '\n); system(line); Oddly, only A and B are echoed, not the eargs. I had hoped that line would be one string at this point, and

Re: [R] Handling of tables in R

2005-08-19 Thread Thomas Lumley
On Fri, 19 Aug 2005, Fredrik Thuring wrote: I have a few questions concerning reading of tables from R to other programs. My main question is if it???s even possible to read a table created in R (with the functions data.frame and save) to Excel (or maybe SAS) and if so how does one do

Re: [R] Handling dates

2005-08-19 Thread Thomas Lumley
On Fri, 19 Aug 2005, [iso-8859-1] G?ran Brostr?m wrote: Similar strange results appear in other date-related functions. I plan to write functions that converts, eg, 1977-01-31 to the real number 1977.084 and back. What function in R does what 'mdy.date' claims to do? Well, mdy.date does

Re: [R] covariance matrix under null

2005-08-26 Thread Thomas Lumley
On Thu, 25 Aug 2005, Devarajan, Karthik wrote: Hello I am fitting a Cox PH model using the function coxph(). Does anyone know how to obtain the estimate of the covariance matrix under the null hypothesis. The function coxph.detail() does not seem to be useful for this purpose. You can

Re: [R] stratified Wilcoxon available?

2005-08-28 Thread Thomas Lumley
Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle__ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R

Re: [R] LaTeX Notations in R output graphs

2005-08-29 Thread Thomas Lumley
On Mon, 29 Aug 2005 [EMAIL PROTECTED] wrote: Hello, I'm interested in LaTeX notations in R graphs. For example, I would like to know the R code to obtain the graph here, http://www.r-project.org/screenshots/power.png Here is the code: x-seq(-10,10,length=400) y1-dnorm(x) y2-dnorm(x,m=3)

Re: [R] Superassignment (-) and indexing

2005-09-02 Thread Thomas Lumley
On Fri, 2 Sep 2005, Brahm, David wrote: In a clean environment under R-2.1.0 on Linux: x - 1:5 x[3] - 9 Error: Object x not found Isn't that odd? (Note x - 9 works just fine.) Well, yes and no. It is the result of a bug fix a version or two ago that dealt with the case where there was

Re: [R] Superassignment (-) and indexing

2005-09-02 Thread Thomas Lumley
On Fri, 2 Sep 2005, Spencer Graves wrote: Permit a mild protest on the word appropriate in this context. The global assignment operator - provides, for my tastes, excessive opportunities for problems. If I define x someplace else and then call your function, it may change my x in

Re: [R] Inconsistence in specifying action for missing data

2005-09-04 Thread Thomas Lumley
On Sat, 3 Sep 2005, John Sorkin wrote: A question for R (and perhaps S and SPlus) historians. Does anyone know the reason for the inconsistency in the way that the action that should be taken when data are missing is specified? There are several variants, na.action, na.omit, T, TRUE, etc. I

Re: [R] survey weights

2005-09-04 Thread Thomas Lumley
On Sat, 3 Sep 2005, A Das wrote: Hi all, I've been trying to get a large (12mb) Stata survey database into R. I managed that, but when I attach survey weights, something goes wrong. The error message is: object dchina not found. Here's the script: If that is the *first* message then

Re: [R] survey weights

2005-09-04 Thread Thomas Lumley
On Sun, 4 Sep 2005, A Das wrote: Thanks, Thomas. Yes, that's exactly what happened: the warnings came first after data(China), and then after dchina-svydesign... So the design object isn't being produced? The dataset is very large, and the weights were already set in Stata before

Re: [R] survey weights

2005-09-04 Thread Thomas Lumley
obsChina - subset(China, !is.na(psu) !is.na(strata) !is.na(weight0x)) and then use obsChina rather than China in the svydesign() function. -thomas -Bobby --- Thomas Lumley [EMAIL PROTECTED] wrote: On Sun, 4 Sep 2005, A Das wrote: Thanks, Thomas. Yes

Re: [R] help

2005-09-05 Thread Thomas Lumley
On Mon, 5 Sep 2005, [EMAIL PROTECTED] wrote: A trap easy to fall into! So easy, in fact, that it's a FAQ. -thomas __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide!

Re: [R] fitting distributions with R

2005-09-06 Thread Thomas Lumley
On Tue, 6 Sep 2005, [EMAIL PROTECTED] wrote: However, a related method available for 'optim' is L-BFGS-B which allows _box constraints_, that is each variable can be given a lower and/or upper bound. The initial value must satisfy the constraints. This can be set in a parameter for 'mle'.

Re: [R] references in the manual to endnote and spanish versions of everything

2005-09-07 Thread Thomas Lumley
On Wed, 7 Sep 2005, Chris Buddenhagen wrote: 1) I have been really pleased with R as a means of doing and learning statistics. I work in a Spanish speaking country- and I wanted to pass on the benefits of R to my Spanish speaking colleagues. There are a couple of introductions to R in Spanish

Re: [R] Survival analysis with COXPH

2005-09-07 Thread Thomas Lumley
are known. I wouldn't use them except when I was actually interested in the variance components, and I haven't worked on any problems like that, so I haven't investigated the issue. [I don't write the survival package, I just port it] -thomas Thomas Lumley Assoc

Re: [R] Prediction with multiple zeros in the dependent variable

2005-09-08 Thread Thomas Lumley
On Thu, 8 Sep 2005, John Sorkin wrote: I have a batch of data in each line of data contains three values, calcium score, age, and sex. I would like to predict calcium scores as a function of age and sex, i.e. calcium=f(age,sex). Unfortunately the calcium scorers have a very ugly distribution.

Re: [R] Survival model with cross-classified shared frailties

2005-09-08 Thread Thomas Lumley
On Thu, 8 Sep 2005, Shige Song wrote: Dear All, The coxph function in the survival package allows multiple frailty terms. Um, no, it doesn't. In all the examples I saw, however, the frailty terms are nested. What will happen if I have non-nested (that is, cross-classified) frailties in

Re: [R] array indices in synced vectors

2005-09-08 Thread Thomas Lumley
On Thu, 8 Sep 2005, Erich Neuwirth wrote: sapply(1:length(xxx),function(x)b[xxx[x],yyy[x]]) does what I need and produces [1] 1 2 1 2 1 4 3 4 3 4 Is there a function taking xxx,yyy, and b as arguments producing the same result? b[cbind(xxx,yyy)] Essentially, I am asking for a version of

Re: [R] data manipulation

2005-09-08 Thread Thomas Lumley
mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle

Re: [R] change in read.spss, package foreing?

2005-09-09 Thread Thomas Lumley
that this is always true since the file format is undocumented). However I could not find a description of this supposed change. It's in the ChangeLog file in the foreign package. -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University

Re: [R] change in read.spss, package foreign?

2005-09-09 Thread Thomas Lumley
On Fri, 9 Sep 2005, Heinz Tuechler wrote: Dear Martin, Thank you for your answer. As I said, I appreciate this change. The documentation does not explain precisely, how variables with labels are treated now. It only tells If SPSS value labels are converted to factors the underlying numerical

[R] [R-pkgs] survey: version 3.3

2005-09-10 Thread Thomas Lumley
://faculty.washington.edu/tlumley/survey/NEWS -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle ___ R-packages mailing list [EMAIL PROTECTED] https://stat.ethz.ch/mailman

Re: [R] Output of warnings inside the source function

2005-09-11 Thread Thomas Lumley
On Sun, 11 Sep 2005, Arkady Sherman wrote: c:\Program Files\R\rw2011\bin\R.exe --no-save test out.txt the file c:/temp/foo.txt will contain nothing. But I'd like it should contain the warning message Foo warning. Is the behavior a bug of R or there is another way to get it working. The

Re: [R] poisson mean hypothesis

2005-09-12 Thread Thomas Lumley
list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle __ R

Re: [R] Bonferroni test?

2005-09-12 Thread Thomas Lumley
On Mon, 12 Sep 2005, Chris Buddenhagen wrote: Is there a simple means of doing this multiple comparison test in R? p.adjust() -thomas __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

Re: [R] Floating-point arithmetic

2005-09-13 Thread Thomas Lumley
On Tue, 13 Sep 2005, [EMAIL PROTECTED] wrote: A recent exchange on the 'octave' list led to the following paper being cited, which I had not met before: What Every Computer Scientist Should Know About Floating-Point Arithmetic, by David Goldberg, snip So I'm writing to bring it to the

Re: [R] coxph.detail() does not work

2005-09-13 Thread Thomas Lumley
On Tue, 13 Sep 2005, Zhen Zhang wrote: Hello everyone, I tried to use coxph.detail() to get the hazard function. But a warning messge always returns to me, even in the example provided by its help document: ?coxph.detail fit - coxph(Surv(futime,fustat) ~ age + rx + ecog.ps, ovarian,

Re: [R] (survexp:) compute the expected remaining survival time

2005-09-22 Thread Thomas Lumley
On Thu, 22 Sep 2005, Anne wrote: DeaR list I would like to know if there is a direct method to compute the expected remaining survival time for a subject having survived up to time t. survexp gives me the probabilty for subject S to survive up to day D You can't estimate expected survival

Re: [R] Problem with read.spss() and as.data.frame(), or: alternative to subset()?

2005-09-23 Thread Thomas Lumley
list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle

Re: [R] p-level in packages mgcv and gam

2005-09-26 Thread Thomas Lumley
On Mon, 26 Sep 2005, Denis Chabot wrote: But the mgcv manual warns that p-level for the smooth can be underestimated when df are estimated by the model. Most of the time my p-levels are so small that even doubling them would not result in a value close to the P=0.05 threshold, but I have one

Re: [R] negative binomial in GEE

2005-09-27 Thread Thomas Lumley
On Tue, 27 Sep 2005, Simon.Bond wrote: Does anyone have any suggestions for a way round this problem for the future (I had to resort to using Stata), or maybe more realistically, how much work it would take to build an extendible version of the gee algorithm? I don't think it would take

Re: [R] Weighting factor

2005-09-27 Thread Thomas Lumley
On Tue, 27 Sep 2005, Ferran Carrascosa wrote: Hi everyone, I would like some package of R or any help to solve the next problem with a weighting fatcors: Giving a data matrix with dichotomous (2 or more) variables in columns and individuals in rows, and also a theorical distribution of the

Re: [R] p-level in packages mgcv and gam

2005-09-28 Thread Thomas Lumley
Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle__ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R

Re: [R] p-level in packages mgcv and gam

2005-09-28 Thread Thomas Lumley
On Wed, 28 Sep 2005, Denis Chabot wrote: But what about another analogy, that of polynomials? You may not be sure what degree polynomial to use, and you have not decided before analysing your data. You fit different polynomials to your data, checking if added degrees increase r2

Re: [R] reshaping data?

2005-09-29 Thread Thomas Lumley
On Thu, 29 Sep 2005, Karin Lagesen wrote: I have a file like this: a 0.1 a 0.2 a 0.9 b 0.5 b 0.9 b 0.7 c 0.6 c 0.99 c 0.88 Which I would like to get to be the following matrix: 0.1 0.20.30.4 ... a 1

Re: [R] regsubsets selection criterion

2005-09-29 Thread Thomas Lumley
On Thu, 29 Sep 2005, Spencer Graves wrote: Questions like this are best directed to the package maintainer(s). From help(package=leaps), I learned that Thomas Lumley is the author and maintainer for leaps; I'm including him as a 'cc', so he can correct or add to my comments if he

Re: [R] Dots in function names

2005-09-30 Thread Thomas Lumley
On Fri, 30 Sep 2005, Mike Prager wrote: Recent R function names seem to be using CaseOfTheLetters to mark words rather than dots as was done previously. Is the use of dots in function names deprecated, or is that simply a style choice? Will function names with dots cause problems in future

Re: [R] C program

2005-09-30 Thread Thomas Lumley
On Fri, 30 Sep 2005, Erin Hodgess wrote: Dear R People: I have R Version 2.1.1. for Windows in binary form. I would like to look at the C code for massdist. It is part of the density function. The .C() call shows that massdist is in the base package. This means that it is likely to be

Re: [R] boxplot statistics

2005-10-04 Thread Thomas Lumley
On Tue, 4 Oct 2005, Karin Lagesen wrote: First, how does boxplot determine the size of the box? And is the line inside the box the mean or the median (or something completely different?) And how does it determine how long out the whiskers should go? Part of the problem is that there are lots

Re: [R] help with loading National Comorbidity Survey

2005-10-04 Thread Thomas Lumley
On Sat, 1 Oct 2005, Jim Hurd wrote: Which provides data in DTA (STATA), XPT (SAS), and POR (SPSS) formats all of which I have tried to read with the foreign package but I am not able to load any of them. I have 2 gb of RAM, but R crashes when the memory gets just over 1 GB. I am using

Re: [R] Survey package and NAMCS data... unsure of specification

2005-10-04 Thread Thomas Lumley
On Tue, 4 Oct 2005, David L. Van Brunt, Ph.D. wrote: Hello, all. I wanted to use the survey package to analyze data from the National Ambulatory Medical Care Survey, and am having some difficulty translating the analysis keywords from one package (Stata) to the other (R). The data were

Re: [R] (no subject)

2005-10-05 Thread Thomas Lumley
guide! http://www.R-project.org/posting-guide.html Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r

Re: [R] Testing strata by covariate interactions in coxph

2005-10-06 Thread Thomas Lumley
On Thu, 6 Oct 2005, Pyy-Martikainen Marjo wrote: I specify a model with strata by covariate interactions. I would like to conduct a Wald test for the null hypothesis no differences between any covariate effects in the 3 groups. The survey package has a function regTermTest (which isn't

Re: [R] Matrix calculations in R--erroneous?

2005-10-07 Thread Thomas Lumley
On Fri, 7 Oct 2005, Peter Muhlberger wrote: Does anyone know how -log(x) can equal 743 but -log(x+0)=Inf? That's what the following stream of calculations suggest: Browse[2] -log ( 1e-323+yMat2 - yMat1 * logitShape(matrix(parsList$Xs, nrow = numXs, ncol=numOfCurves), matrix(means, nrow =

Re: [R] Matrix calculations in R--erroneous?

2005-10-09 Thread Thomas Lumley
On Fri, 7 Oct 2005, Peter Muhlberger wrote: The max function won't do the trick because I need the entire matrix. I could do one cell at a time, but this is part of a ML routine that needs to be evaluated hundreds of thousands of times, so I can't afford to slow it down that much. pmax,

Re: [R] Question about Survey Package

2005-10-10 Thread Thomas Lumley
svyratio(~as.numeric(y1*(id21)), ~as.numeric(id21), design=dmu284) All three give the same mean estimator and standard error. -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington

Re: [R] problem with lapply(x, subset, ...) and variable select argument

2005-10-10 Thread Thomas Lumley
__ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED

Re: [R] problem with lapply(x, subset, ...) and variable select argument

2005-10-11 Thread Thomas Lumley
On Tue, 11 Oct 2005, joerg van den hoff wrote: many thanks to thomas and gabor for their help. both solutions solve my problem perfectly. but just as an attempt to improve my understanding of the inner workings of R (similar problems are sure to come up ...) two more question: 1. why

Re: [R] Logistic Regression using glm

2005-10-11 Thread Thomas Lumley
-project.org/posting-guide.html Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] extracting from data frame multiple times

2005-10-14 Thread Thomas Lumley
On Fri, 14 Oct 2005, Ido M. Tamir wrote: Hello, i am trying to subset a dataframe multiple times: something like: stats - by(df, list(items), ttestData) ttestData - function(df){ t.test( df[,c(2,3,4), df[,c(5,6,7)] } While this works for small data, it is to slow for my actual

Re: [R] Problem with ordered logistic regression using polr function.

2006-07-19 Thread Thomas Lumley
the problem? You can specify Hess=TRUE in the original polr() call so that refitting would not be necessary. This is sensible anyway if you know you are going to be computing standard errors. -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED

Re: [R] voronoi tessellations

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

Re: [R] How to find S4 generics?

2006-07-19 Thread Thomas Lumley
-allGenerics()@.Data sigs-lapply(gens, function(g) linearizeMlist(getMethods(g))@classes) names(sigs)[EMAIL PROTECTED] sigs-lapply(sigs, function(gen){ gen[unlist(sapply(gen, function(sig) any(sig %in% classes)))]}) sigs[sapply(sigs,length)0] } Thomas Lumley Assoc. Professor

Re: [R] showMethods()! Re: How to find S4 generics?

2006-07-20 Thread Thomas Lumley
in this discussion is probably the better route. The main remaining problem in my code is that with super=TRUE it will report all inherited methods, even where more specific methods override them. That should be fixable. -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL

Re: [R] Using corStruct in nlme

2006-07-20 Thread Thomas Lumley
, minimal, self-contained, reproducible code. Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] Order-restricted inference

2006-07-21 Thread Thomas Lumley
. New York: John Wiley and Sons. -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r

Re: [R] Weibull distribution

2006-07-21 Thread Thomas Lumley
On Fri, 21 Jul 2006, Valentin Dimitrov wrote: Dear Leaf, I modified your code as follows: gamma.fun - function(mu,sd,start=100) { f.fn - function(alpha) {abs(sd^2-mu^2/(gamma(1+1/alpha))^2*(gamma(1+2/alpha)-(gamma(1+1/alpha))^2))} alpha - optim(start, f.fn) beta -

Re: [R] Branching on 'grep' returns...

2006-07-26 Thread Thomas Lumley
as the input, and reducing functions, which return a vector of length 1. The == operator is vectorized, but if() requires a condition of length 1, so they don't match. The solution is to apply some reducing function. Two possible options are length() and (as you found) any(). -thomas Thomas

Re: [R] bug?

2006-07-26 Thread Thomas Lumley
point may come close (there was a message yesterday from someone trying to interface pari/gp, which does this, with R). -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle

Re: [R] dyn.load, dyn.unload -memory management

2006-07-28 Thread Thomas Lumley
On Fri, 28 Jul 2006, johan Faux wrote: hello everybody, I have some code which looks like: dyn.load(lpSolve.so) res - lp(some.parameters) and everything runs fine. What lp() does, it's just calling a C function which is in lpSolve.so If I call lp() a large number of times: for(1 in

Re: [R] Log color scale

2006-07-31 Thread Thomas Lumley
of the scale. -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle__ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] Indexing issue

2006-08-01 Thread Thomas Lumley
On Tue, 1 Aug 2006, Swidan, Firas wrote: Hi, R is having the following weird behavior and I am not sure if that is a feature or a bug: It's a feature. And a very old FAQ (#7.5) I am working on the following 3D array: bIm , , 1 [,1] [1,] TRUE [2,] TRUE [3,] TRUE [4,] TRUE [5,]

  1   2   3   4   5   6   7   8   9   10   >