Re: [R] how to 'get' an object that is part of a list

2006-12-24 Thread Duncan Murdoch
On 12/24/2006 12:06 AM, Christos Hatzis wrote: This might be an trivial thing but I am stuck. Consider: xx - list(a=1:5, b=letters[1:5]) Although object xx is accessible through its name, how can object xx$b be accessed similarly through its name? name - b xx[[name]] will work.

Re: [R] how to 'get' an object that is part of a list

2006-12-24 Thread Gabor Grothendieck
Is this what you are looking for: my.length.2 - function(...) { +f - function(nm, val) length(val) +mapply(f, make.names(as.list(match.call()[-1])), list(...)) + } my.length.2(xx, xx$b) xx xx.b 25 On 12/24/06, jim holtman [EMAIL PROTECTED] wrote: use 'eval' and 'parse' xx

Re: [R] extend summary.lm for hccm?

2006-12-24 Thread John Fox
Dear Dirk and Ivo, It's true that the sandwich package has more extensive facilities for sandwich variance estimation than the hccm function in the car package, but I think that the thrust of Ivo's question is to get a model summary that automatically uses the adjusted standard errors rather than

Re: [R] extend summary.lm for hccm?

2006-12-24 Thread Frank E Harrell Jr
John Fox wrote: Dear Dirk and Ivo, It's true that the sandwich package has more extensive facilities for sandwich variance estimation than the hccm function in the car package, but I think that the thrust of Ivo's question is to get a model summary that automatically uses the adjusted

Re: [R] extend summary.lm for hccm?

2006-12-24 Thread John Fox
Dear Frank, If I remember Freedman's recent paper correctly, he argues that sandwich variance estimator, though problematic in general, is not problematic in the case that White described -- an otherwise correctly specified linear model with heteroscedasticity estimated by least-squares.

Re: [R] extend summary.lm for hccm?

2006-12-24 Thread Frank E Harrell Jr
John Fox wrote: Dear Frank, If I remember Freedman's recent paper correctly, he argues that sandwich variance estimator, though problematic in general, is not problematic in the case that White described -- an otherwise correctly specified linear model with heteroscedasticity estimated by

Re: [R] OT: any recommendation for scripting language

2006-12-24 Thread BBands
On 12/23/06, Wensui Liu [EMAIL PROTECTED] wrote: if you recommend one, I will really appreciate it if you could point out a good source for learning as well. We have found Python to be the perfect choice for our work. Python is a high-level, cross-platform language that is easy to learn/write

Re: [R] extend summary.lm for hccm?

2006-12-24 Thread ivo welch
thank you, everybody. It's hard to find much fault with R, but one feature that would be nice to have would be hooks to output functions that make it easy to augment to the output---e.g., to add a new statistic to summary (e.g., mean, sd, different stderrs). not a big flaw, because one can write

Re: [R] OT: any recommendation for scripting language

2006-12-24 Thread Richard Graham
On 12/23/06, Wensui Liu [EMAIL PROTECTED] wrote: from statisticians' point of view, which scripting language is worth to learn, perl, python, or any other recommendation? (Most likely, I will be learning it in windows.) Since I am not in research, I will prefer one widely used in industry and

[R] Higher Dimensional Matrices

2006-12-24 Thread downunder
Hi all. I want to calculate partial correlations while controlling for one or more variables. That works already fine when I control for example just for x[,1] and x[,2] that gives me one single correlation matrix and i have to to it for x [,1]...x[,10]. That would give me out 10 matrices.

Re: [R] how to 'get' an object that is part of a list

2006-12-24 Thread Christos Hatzis
Thank you Gabor. Very interesting solution. If I get it right, the first argument in function f is just a placeholder to help extract the right element out of the list(...) that is passed to length. Very smart trick. Jim's solution appears a bit simpler, at least along the lines that I was