[R] Pre-allocation of matrices is LESS efficient?

2011-02-17 Thread Alex F. Bokov
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 zeros to what I know to be the maximum number of rows. I was su

[R] summary.lm as a post-hoc test?

2010-10-30 Thread Alex F. Bokov
Let's assume that according to Anova(lm(y~a*b, data=d)) the a:b interaction is significant, and I would like to know if there are specific combinations of a and b levels that differ from the control group. Are there any caveats against simply looking at the p-values in the output generated by s

[R] Using coxph with Gompertz-distributed survival data.

2010-02-04 Thread Alex F. Bokov
Dear list: I am attempting to use what I thought would be a pretty straightforward practical application of Cox regression. I figure users of the survival package must have come across this problem before, so I would like to ask you how you dealt with it. I have set up an illustrative example a

[R] How to unload a dll loaded via library.dynam()?

2009-02-19 Thread Alex F. Bokov
Hello. To save the hassle of quitting and restarting R every time I rebuild the package I'm working on (for the purposes of this question called "roots") I would like to write a script cleanly remove the package from my R session and then load it again. Of course detach("package:roots") works fo

[R] optim, constrOptim: setting some parameters equal to each other

2008-06-08 Thread Alex F. Bokov
Hello, and apologies for the upcoming naive questions. I am a biologist who is trying to teach himself the appropriate areas of math and stats. I welcome pointers to suggested background reading just as much as I do direct answers to my question. Let's say I have a function F() that takes varia