Re: [R] Plotting individual survival plots

2006-12-18 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] MAXIMIZATION WITH CONSTRAINTS

2006-12-08 Thread Thomas Lumley
-guide.html and provide commented, 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

Re: [R] Canonical method for S engine selection?

2006-12-06 Thread Thomas Lumley
On Wed, 6 Dec 2006, Paul Roebuck wrote: Assuming script 'common.q' contains code that needed different processing depending on interpreter (either S-PLUS or R), what should the condition be? I believe exists(is.R) is.R() is a reliable condition. -thomas

Re: [R] using R for survival analysis

2006-12-05 Thread Thomas Lumley
-- since this determines how many different logistic models for treatment you will need. -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle __ R-help@stat.math.ethz.ch

Re: [R] Weight and see

2006-12-04 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] Statistical Software Comparison

2006-11-22 Thread Thomas Lumley
stiffer than in R. -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] do.call(+, ...)

2006-11-17 Thread Thomas Lumley
On Fri, 17 Nov 2006, Robin Hankin wrote: OK, I see. But in algebra the + symbol is special: it is reserved exclusively for associative and commutative operations [thus a+b+c is always well-defined]; perhaps the parser could fall in with this convention? It's not so long ago that we had a

Re: [R] Plot title with numeric variables

2006-11-15 Thread Thomas Lumley
is that the title is defined ahead, passed to a function that makes many plots, and n is incremented for each plot. pretitle - quote(bold(Figure~.(N)~Plot~C[max]~versus CrCl)) ## later on inside a function N-1 title-do.call(bquote,list(pretitle)) -thomas Thomas Lumley Assoc

Re: [R] Variance of a complex estimator using survey package ...

2006-11-14 Thread Thomas Lumley
On Tue, 14 Nov 2006, justin bem wrote: Hi, I want to compute the variance of two complex statistics. The first statistic is the a ratio R1=Q(a1)/Q(a2) where Q denote de quantile at a1 and a2. The second is also a ratio but not a classic one this ratio is

Re: [R] Extracting parameters for Gamma Distribution

2006-11-08 Thread Thomas Lumley
On Tue, 7 Nov 2006, yongchuan wrote: I'm doing a cox regression with frailty: model - coxph(Surv(Start,Stop,Terminated)~ X + frailty(id),table) I understand that model$frail returns the group level frailty terms. Does this mean this is the average of the frailty values for the respective

Re: [R] gamm(): degrees of freedom of the fit

2006-11-01 Thread Thomas Lumley
On Wed, 1 Nov 2006, Fabian Scheipl wrote: Calculating the smoother/projection matrix S: y - \hat y and then its trace by sum(eigen(S))$values is what I've been doing so far- but I was hoping there might be a more efficient way than doing the spectral decomposition of an NxN-matrix. Well,

Re: [R] Incorrect 'n' returned by survfit()

2006-10-28 Thread Thomas Lumley
. The initial default is 'start'. -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

Re: [R] Help with understanding [[]] [] array, list, matrix referencing

2006-10-24 Thread Thomas Lumley
On Tue, 24 Oct 2006, Joe W. Byers wrote: following code produces a 5 element list of 2X5 random numbers that I then convert to a 2X5X5 matrix. cov-matrix(c(.4,-.1,-.1,.3),nrow=2,ncol=2) rnds-NULL; for (i in 1:5){ t1-rnorm(5,cov) t2-rnorm(5,cov) t3-rbind(t1,t2)

Re: [R] one is not one

2006-10-23 Thread Thomas Lumley
On Sat, 21 Oct 2006, Philipp Pagel wrote: On Sat, Oct 21, 2006 at 11:04:13AM +0200, Patrick Giraudoux wrote: Which means that actually sum(x) is NOT considered equal to 1... Any idea about what is going wrong? Others have already pointed out the problem and I would like to add a reference

Re: [R] Forest plot

2006-10-20 Thread Thomas Lumley
and flexible forestplot() function in the 'rmeta' package. -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch

Re: [R] I really don't understand functions in R :-)

2006-10-20 Thread Thomas Lumley
On Fri, 20 Oct 2006, Alberto Monteiro wrote: An example: n - 3 f - function(x) x^n f(2) # [1] 8 n - 2 f(2) # [1] 4 f # function(x) x^n Ok, I know this is trivial, because function f is foverer bound to the variable n. But how can I _fix_ n when I define _f_, so that changing _n_

Re: [R] Error Correcting Codes, Simplex

2006-10-17 Thread Thomas Lumley
On Tue, 17 Oct 2006, Richard Graham wrote: On 10/16/06, Björn Egert [EMAIL PROTECTED] wrote: On 10/8/06, Egert, Bjoern [EMAIL PROTECTED] wrote: Hello, Is there a way in R to construct an (error correcting) binary code e.g. for an source alphabet containing integers from 1 to say 255

Re: [R] mitools, multiple imputation

2006-10-15 Thread Thomas Lumley
On Sat, 14 Oct 2006, John Sorkin wrote: R 2.2.0 windows XP I am beginning to explore the mitools package contributed by Thomas Lumley (thank you Thomas) and I have a few questions: (1) In the examples given in the mitools documentation, the only family argument used is family=binomial

Re: [R] Rmpi performance

2006-10-13 Thread Thomas Lumley
On Fri, 13 Oct 2006, Michela Cameletti wrote: Dear R users, we are trying to do some parallel computing using library(snow). In particular we have a cluster with 3 nodes cl - makeCluster(3, type = MPI) 3 slaves are spawned successfully. 0 failed. and we want to compute the

Re: [R] how to get the variance-covariance matrix/information of alpha and beta after fitting a GLMs?

2006-10-12 Thread Thomas Lumley
attributes(B) to look for the options ,but can't find it, anybody knows how to get it? vcov(your.model) -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle __ R-help

Re: [R] update.default evaluating in wrong environment?

2006-10-10 Thread Thomas Lumley
On Tue, 10 Oct 2006, Martin C. Martin wrote: Thanks, or even just: e - environment(formula(f.lm)) But this was more of a bug report. Is update.default wrong? Should it be changed? I don't see how evaluating in update's parent environment would ever be better default behavior than the

Re: [R] Sum of Bernoullis with varying probabilities

2006-10-09 Thread Thomas Lumley
distinct terms to be added, and your code seems to be doing that as directly as possible. Not necessarily. It could be quicker to numerically invert the characteristic function, which is easy to compute. -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL

Re: [R] ifelse(logical, function1, function2) does not work

2006-10-09 Thread Thomas Lumley
on, in that a vector of one number is the same as that number, but a list of one function is not the same as the function. -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle

Re: [R] Re : Complex survey analysis help

2006-10-01 Thread Thomas Lumley
(except for the impractical one that requires pairwise sampling probabilities). I would welcome suggested references (especially if they are in English). -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle

Re: [R] Confidence interval in the Wilcoxon exact test

2006-09-29 Thread Thomas Lumley
On Fri, 29 Sep 2006, [EMAIL PROTECTED] wrote: Hi, Two functions wilcox.exact and wilcox_test give slightly different confidence intervals of the difference of the medians: for example y-c(0,0,1.081,0.594,0,0.769,0,0.009,0,0,0.798,0.405,0.498,0.946,1.35,1.149,0.528) x-c(rep(1,10),rep(2,7))

Re: [R] set off error messages

2006-09-26 Thread Thomas Lumley
On Tue, 26 Sep 2006, Mollet, Fabian wrote: Hello there! I'm creacting a loop for(i in 1:n){...}within which I build a nls model at each iteration. for some of the values of i, the algoritm in the nls function doesn't converge or cannot find a solution and consequently an error message is

Re: [R] Complex survey analysis help

2006-09-24 Thread Thomas Lumley
with repetion ? I try fpc1-rep(0,length(data)) I get a error message. For sampling with replacement you just omit the fpc and specify the first-stage id and the sampling weights E3stage -svydesign(ids=~stageid1, weights=~weights) -thomas Thomas Lumley Assoc. Professor

Re: [R] extract data from lm object and then use again?

2006-09-22 Thread Thomas Lumley
On Fri, 22 Sep 2006, Thilo Kellermann wrote: Hi, the data of the model fit is stored in lm$model and should work Not reliably. In the first place, you should use the accessor function model.frame(model) rather than model$model, which works even if the model was fitted with model=FALSE.

Re: [R] how to store recursive results

2006-09-22 Thread Thomas Lumley
On Fri, 22 Sep 2006, X.H Chen wrote: Hi Gabor, Thanks for pointing out this for me. However, what I try to get is how to construct such form a function f that ret-f(...), where ret contains the each recursive result from f, and meantime f consists of no - operator. Do you have any idea

Re: [R] survival function with a Weibull dist

2006-09-21 Thread Thomas Lumley
On Thu, 21 Sep 2006, Anaid Diaz wrote: Hi I am using R to fit a survival function to my data (with a weibull distribution). Data: Survival of individuals in relation to 4 treatments ('a','b','c','g') syntax: survreg(Surv(date2)~males2, dist='weibull') But I have some problems

Re: [R] Multiple matrix multiplication with two 3-dimensional arrays

2006-09-09 Thread Thomas Lumley
(matrices) there are only four possible sums over one margin: x %*% y, y%*%x, crossprod(x,y), tcrossprod(x,y), but with rank-3 tensors there are a lot more options. -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington

Re: [R] terms.inner

2006-09-05 Thread Thomas Lumley
) } carrier.name - function(term) { if (length(term) 1) carrier.name(term[[2]]) else as.character(term) } to do the job. -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle

Re: [R] Running cox models

2006-09-03 Thread Thomas Lumley
On Sun, 3 Sep 2006, Geoff Russell wrote: Hi, I'm reading van Belle et al Biostatistics and trying to run a cox test using a dataset from: http://faculty.washington.edu/~heagerty/Books/Biostatistics/chapter16.html (Primary Biliary Cirrhosis data link at top of the page), I'm using the

Re: [R] forestplot fucntion in rmeta package

2006-08-31 Thread Thomas Lumley
. More importantly, although it would be easy to not draw the x axis, it wouldn't help at all, since axis() still wouldn't work. -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle

Re: [R] alpha in Holt-Winters method

2006-08-31 Thread Thomas Lumley
On Thu, 31 Aug 2006, MARK LEEDS wrote: you would have to take your series, y_1, ... y_t and run it over various values of alpha ( say zero to 1 insteps of .01 ) and see which one gives say the least MSE. but that will be the optimal alpha for the window you are looking at. it doesn't mean it

Re: [R] working with summarized data

2006-08-30 Thread Thomas Lumley
On Wed, 30 Aug 2006, Rick Bischoff wrote: Unfortunately, it seems that most(all?) of R's graphics and summary statistic functions don't take a weight or frequency argument. (Fortunately the models do...) I have been been meaning to add this functionality to my graphics package ggplot

Re: [R] Substring and strsplit

2006-08-29 Thread Thomas Lumley
On Tue, 29 Aug 2006, Erin Hodgess wrote: Dear R People: I am trying to split a character vector into a set of individual letters: Ideal: x3 - c(dog) d o g I tried the following: strsplit(x3) Error in strsplit(x3) : argument split is missing, with no default strsplit(x3,1) [[1]] [1]

Re: [R] matrix Adjoint function

2006-08-28 Thread Thomas Lumley
which will compute the cofactor of matrix A or the adjoint of a real matrix A? If that's what you mean by adjoint, then the adjoint is the inverse multiplied by the determinant. adjoint-function(A) det(A)*solve(A) -thomas Thomas Lumley Assoc. Professor

Re: [R] extremely slow recursion in R?

2006-08-25 Thread Thomas Lumley
). There's a conference in New Zealand in February and abstract submissions are still open. -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle __ R-help@stat.math.ethz.ch

[R] [R-pkgs] biglm 0.4

2006-08-25 Thread Thomas Lumley
biglm fits linear and generalized linear models to large data sets, using bounded memory. What's New: generalized linear models. -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle

Re: [R] increasing the # of socket connections

2006-08-25 Thread Thomas Lumley
). You need to change #define NCONNECTIONS 50 at the top of src/main/connections.c and recompile. -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle __ R-help

Re: [R] horizontal direct product

2006-08-25 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] fixed effects transformation

2006-08-24 Thread Thomas Lumley
On Wed, 23 Aug 2006, Eduardo Leoni wrote: I created this function following Farnsworth (http://cran.r-project.org/doc/contrib/Farnsworth-EconometricsInR.pdf) demean - function(x,index) { for (i in unique(index)) { for (j in 1:ncol(x)) { x.now - x[index==i,j] x[index==i,j] -

Re: [R] Why are lagged correlations typically negative?

2006-08-24 Thread Thomas Lumley
the covariance may be useful even for non-mathematicians. Call the three points X,Y,Z cov(X-Y, Y-Z) = cov(X,Y)-cov(Y,Y)-cov(X,Z)+cov(Y,Z) =0- var(Y) -0 -0 -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED

Re: [R] metaplot and meta.summaries

2006-08-24 Thread Thomas Lumley
= random) It means that NaNs were produced. You should be able to see where from the output. It's hard to say more without more information. -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle

Re: [R] extremely slow recursion in R?

2006-08-24 Thread Thomas Lumley
that isn't making use of vectorized functions in R. -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch

Re: [R] lean and mean lm/glm?

2006-08-23 Thread Thomas Lumley
On Wed, 23 Aug 2006, Damien Moore wrote: Thomas Lumley wrote: No, it is quite straightforward if you are willing to make multiple passes through the data. It is hard with a single pass and may not be possible unless the data are in random order. Fisher scoring for glms is just

Re: [R] lean and mean lm/glm?

2006-08-23 Thread Thomas Lumley
On Wed, 23 Aug 2006, Damien Moore wrote: Thomas Lumley [EMAIL PROTECTED] wrote: I have written most of a bigglm() function where the data= argument is a function with a single argument 'reset'. When called with reset=FALSE the function should return another chunk of data, or NULL

Re: [R] lean and mean lm/glm?

2006-08-22 Thread Thomas Lumley
On Mon, 21 Aug 2006, Damien Moore wrote: For very large regression problems there is the biglm package (put you data into a database, read in 500,000 rows at a time, and keep updating the fit). thanks. I took a look at biglm and it seems pretty easy to use and, looking at the source,

Re: [R] Marginal Predicitions from nlme and lme4

2006-08-22 Thread Thomas Lumley
On Tue, 22 Aug 2006, Rick Bilonick wrote: On Wed, 2006-08-23 at 06:43 +1000, Andrew Robinson wrote: Rick, if by marginal prediction, you mean the prediction without random effects, then use the level argument. See ?predict.lme or ?fitted.lme If not then I don't know :) Cheers Andrew

Re: [R] interpreting coxph results

2006-08-21 Thread Thomas Lumley
@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 Assoc. Professor, Biostatistics [EMAIL PROTECTED

Re: [R] vcov error in svyby and svytable functions

2006-08-21 Thread Thomas Lumley
On Mon, 21 Aug 2006, Debarchana Ghosh wrote: Hi, I'm trying to compute survey svytable statistic on subsets by using the svyby function. Here is the code: b-svyby(~V024+V751, by=~V025, design=strat2, svytable, round=TRUE) The vars, V024, V751 and V025 are factors. The by var has 2

Re: [R] Puzzling warning using 2.3.1...

2006-08-13 Thread Thomas Lumley
agree then the files are the same as when the installer was built. There is negligible probability that a change in the file will leave the MD5 hash the same. -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington

Re: [R] read.spss and umlaut

2006-08-04 Thread Thomas Lumley
the file format. I will look at adding an option to specify an encoding and ignore the translation table, but not very urgently. -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington

Re: [R] read.spss and umlaut

2006-08-03 Thread Thomas Lumley
On Thu, 3 Aug 2006, Thomas Kuster wrote: Hello Am Mittwoch, 2. August 2006 17.11 schrieb Thomas Lumley: This sounds like a conflict between encodings -- eg if R is assuming UTF-8 and the file is encoding in Latin-1 then the sequence U+00FC : LATIN SMALL LETTER U WITH DIAERESIS U+0072 : LATIN

Re: [R] Vectorizing a for loop

2006-08-03 Thread Thomas Lumley
On Thu, 3 Aug 2006, Daniel Gerlanc wrote: Hello all, Consider the following problem: There are two vectors: rows - c(1, 2, 3, 4, 5) columns - c(10, 11, 12, 13, 14) I want to create a matrix with dimensions length(rows) x length(columns): res - matrix(nrow = length(rows), ncol =

Re: [R] get() in sapply() in with()

2006-08-03 Thread Thomas Lumley
because get() looks in the environment it was called from, which is df1. -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle __ R-help@stat.math.ethz.ch mailing list

Re: [R] question about dll crashing R

2006-08-03 Thread Thomas Lumley
/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle __ R-help@stat.math.ethz.ch mailing list

Re: [R] read.spss and umlaut

2006-08-03 Thread Thomas Lumley
to modify the translation table to allow the accented characters. It looks as though SPSS .sav files don't have this limitation. -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle

Re: [R] read.spss 'error reading system-file header'

2006-08-03 Thread Thomas Lumley
SPSS files than the code in the foreign package, and that could be adapted. -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle__ R-help@stat.math.ethz.ch mailing

Re: [R] read.spss and umlaut

2006-08-02 Thread Thomas Lumley
, 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 PLEASE do read the posting

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

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] 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] 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] 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] 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] 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] Nested functions

2006-07-18 Thread Thomas Lumley
On Mon, 17 Jul 2006, John Wiedenhoeft wrote: Hi there, I'm having myself a hard time writing an algorithm for finding patterns within a given melody. In a vector I'd like to find ALL sequences that occur at least twice, without having to check all possible patterns via pattern matching.

Re: [R] FW: Large datasets in R

2006-07-18 Thread Thomas Lumley
well over the years. -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] I think this is a bug

2006-07-18 Thread Thomas Lumley
://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 Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington

Re: [R] Survey-weighted ordered logistic regression

2006-07-18 Thread Thomas Lumley
linearisation standard errors, but that would require writing out the loglikelihood and its gradient, which is tedious (although you could borrow most of it from MASS::polr) -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University

Re: [R] Question about summing to zero

2006-07-18 Thread Thomas Lumley
$double.eps, treating the errors as a random walk, and this is not far off (though perhaps only coincidentally so). -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle

Re: [R] Large datasets in R

2006-07-17 Thread Thomas Lumley
with that size of data set for most analyses. You might come across some analyses (eg some cluster analysis functions) that use n^2 memory for n observations and so break down. -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University

Re: [R] Proportional Hazard Function and Competing risks

2006-07-11 Thread Thomas Lumley
. -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 the posting guide

Re: [R] parametric proportional hazard regression

2006-07-10 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

Re: [R] survfit, unused argument(s) (error ...)

2006-07-10 Thread Thomas Lumley
at the code it seems that you need vartype=greenwood, so the documentation is wrong. -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle__ R-help@stat.math.ethz.ch

Re: [R] problem in my code

2006-07-10 Thread Thomas Lumley
in a lexical parent environment it makes no sense to do it directly at the command line. -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle __ R-help

Re: [R] parametric proportional hazard regression

2006-07-07 Thread Thomas Lumley
using survreg() in the survival package. -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

Re: [R] Multistage Sampling

2006-07-07 Thread Thomas Lumley
of the total (with the corrections above) on this variable also gives sqrt(var.yT) [1] 5.54824 -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle __ R-help

Re: [R] Robust standard errors in logistic regression

2006-07-05 Thread Thomas Lumley
-of-implementation issue and partly because of theoretical difficulties with, eg, lms(). -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle __ R-help@stat.math.ethz.ch

Re: [R] macro facility in R

2006-07-03 Thread Thomas Lumley
On Mon, 3 Jul 2006, John Sorkin wrote: R 2.2 on windows XP I have a dataset with multiple columns. Some of the columns represent independent variables, some represent dependent variables. I would like to run the same analyses on a fixed set of independent variables, changing only the

Re: [R] median of gamma distribution

2006-06-30 Thread Thomas Lumley
On Fri, 30 Jun 2006, Philip He wrote: Doese anyone know a R function to find the median of a gamma distribution? It's not clear what you mean. If you know the parameters of a gamma distribution then qgamma() will give you any quantile. If you have data and want to estimate the median then

Re: [R] Random numbers from noncentral t-distribution

2006-06-30 Thread Thomas Lumley
On Fri, 30 Jun 2006, Long Qu wrote: Hi there: I'd thought these two versions of noncentral t-distribution are essentially the same: qqplot(rt(1000,df=20,ncp=3),qt(runif(1000),df=20,ncp=3)) But, the scales of the x-axis and the y-axis are quite different according to the QQ-plot.

Re: [R] Random numbers from noncentral t-distribution

2006-06-30 Thread Thomas Lumley
=20,ncp=3),from=-10,to=-2,n=1000) The fix is less obvious here. I'll file it as a bug. -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle __ R-help@stat.math.ethz.ch

Re: [R] How to use a for loop to generate two sequences

2006-06-29 Thread Thomas Lumley
On Thu, 29 Jun 2006, Xiaohua Dai wrote: Hi R users, Hope the question is not too simple: How to use a for loop to generate two lists as below: testlist - list(test1, test2, ..., test1000) stringlist - list(test1,test2,...,test1000) I don't know why you would want to use a for loop:

Re: [R] Random numbers negatively correlated?

2006-06-27 Thread Thomas Lumley
On Tue, 27 Jun 2006, Christian Hennig wrote: Dear list, I did simulations in which I generated 1 independent Bernoulli(0.5)-sequences of length 100. I estimated p for each sequence and I also estimated the conditional probability that a one is followed by another one (which should be p

Re: [R] Random numbers negatively correlated?

2006-06-27 Thread Thomas Lumley
On Tue, 27 Jun 2006, Thomas Lumley wrote: I got the table wrong, it should read x1/0 1/1 est11 000 - - - 001 - - - 010 1 0 0 011 0 1 1 100 1 0 0 101 1 0 0 110 1 1 0.5 111 0 2 1 So the explanation is slightly

Re: [R] probably need to se sapply but i can't get it

2006-06-26 Thread Thomas Lumley
On Mon, 26 Jun 2006, [EMAIL PROTECTED] wrote: Hi : I think I need to use sapply but I can't figure this out. Suppose I have two vectors : tempa ( 4, 6,10 ) and tempb ( 11,23 ,39 ) I want a function that returns 4:11,6:23 and 10:39 as vectors. I tried : sapply(1:length(tempa) function

Re: [R] integrate

2006-06-23 Thread Thomas Lumley
On Fri, 23 Jun 2006, Rogério Rosa da Silva wrote: Dear All, My doubt about how to integrate a simple kernel density estimation goes on. I have seen the recent posts on integrate density estimation, which seem similar to my question. However, I haven't found a solution. I have made two simple

Re: [R] strange digit switching

2006-06-19 Thread Thomas Lumley
[[alternative HTML version deleted]] __ 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

Re: [R] lmer binomial model overestimating data?

2006-06-19 Thread Thomas Lumley
On Wed, 14 Jun 2006, Martin Henry H. Stevens wrote: Hi folks, Warning: I don't know if the result I am getting makes sense, so this may be a statistics question. The fitted values from my binomial lmer mixed model seem to consistently overestimate the cell means, and I don't know why. I

Re: [R] Post Stratification

2006-06-19 Thread Thomas Lumley
: (n/(n-1))*((N-sum(nh))/N)*sum(yr2*(Nh/nh)^2)/(N*N) [1] 0.45393 where yr2-by(yres^2,age$stratum,sum). These agree exactly with R's estimates vcov(svytotal(~y, design=age.post)) y y 330.915 vcov(svymean(~y, design=age.post)) y y 0.45393 -thomas Thomas Lumley

Re: [R] Calculating survival for set time intervals

2006-06-12 Thread Thomas Lumley
30 4 30.292 0.139 0.11480.741 40 2 10.194 0.122 0.05690.664 -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle

Re: [R] apologies if you aready received this ?

2006-06-09 Thread Thomas Lumley
be par(ask=TRUE). However, when I have this problem I usually just send all the plots to a PDF file, so I can page through them at my leisure. -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle

<    1   2   3   4   5   6   7   8   9   10   >