[R] Memory usage decreases drastically after save workspace, quit, restart, load workspace

2006-08-25 Thread Klaus Thul
Dear all,

I have the following problem:

  - I have written a program in R which runs out of physical memory  
on my MacBook Pro with 1.5 GB RAM

  - The memory usage is much higher then I would expect from the  
actual data in my global environment

  - When I save the workspace, quit R, restart R and load the  
workspace again, memory usage is much less then before
(~50 MB instead of ~1.5 GB), although nothing seems to be missing.

  - It doesn't seem to be possible to reduce the amount of memory  
used by calling gc()

  - the behavior is independent of if I use R in command line or from  
GUI, so I can exclude a problem of the Mac GUI

Any suggestions what the problem might be or how I could debug this?

Thanks in advance for any help.

Best regards,
Klaus


platform   i386-apple-darwin8.6.1
arch   i386
os darwin8.6.1
system i386, darwin8.6.1
status
major  2
minor  3.1
year   2006
month  06
day01
svn rev38247
language   R
version.string Version 2.3.1 (2006-06-01)

__
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.


[R] Problem with stepAIC, "invalid second argument"

2004-12-26 Thread Klaus Thul
Dear all,

am I doing something wrong, or is this a bug (R 2.0.1 & 1.9.1,
linux&windows):

> library(MASS)
> df <- data.frame(x = rnorm(100), y = rnorm(100), z = rnorm(100))
> f <- lm(x ~ y + z, data = df)
> stepAIC(f, scope = list(upper = ~y * z, lower = ~1))
Start:  AIC= -16.56
 x ~ y + z
Error in eval(expr, envir, enclos) : invalid second argument
>


I can avoid the problem doing the following, but in my application I do
not want to use attach / detach because of possible name conflicts:

> attach(df)
> f <- lm(x ~ y + z)
> stepAIC(f, scope = list(upper = ~y * z, lower = ~1))
Start:  AIC= 23.55
 x ~ y + z

...

Call:
lm(formula = x ~ 1)

Coefficients:
(Intercept)
-0.1972
> detach(df)


Thanks for any help,
Klaus Thul

__
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


[R] Question to NLME, ML vs. REML

2004-09-05 Thread Klaus Thul
Dear all,

I am planning to use nlme library for analysis of experiments in semiconductor 
industry. Currently I am using "lm" but plan to move to "lme" to handle 
within wafer / wafer-to-wafer and lot-to-lot variation correctly. 

So far everything is working well, but I have a fundamentel question: 

NLME offers "maximum likelihood" and "restricted maximum likelihood" for 
parameter estimation. ML has the advantage, that likelihood ratios can be 
computed even with changes in model structure. In addition, ML works with the 
stepAIC function from MASS-library which I am currently using for 
model-building.

I am wondering, why REML is the default setting in NLME and therefore somehow 
preferred by the authors. What is the main reason to use REML? 

Maybe I am lacking here statistical knowledge. Any hint, including reference 
to literature would be very helpful.

Best regards,
Klaus Thul

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] residuals() with missing data, alignment to original data set

2003-01-14 Thread klaus . thul
Hello, 

I have a data frame and want to do the following.

Do a regression of one variable versus another:

fit <- lm(a ~ b)

Then I would like to plot the residuals of this fit versus a third variable:

bwplot(residuals(fit) ~ group)

This fails, if a or b contain NAs, because the data in the residuals() -
vector are not aligned anymore to the data in the original data frame.

Is there a way to solve this issue?

Regards and thanks for your help
Klaus

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help