[R] return()

2006-12-18 Thread Timothy . Mak
Dear R Help, 

Why is it that if you try to return more than one objects using return(), 
it says it is 'deprecated'? So how do I return more than 1 objects back to 
the parent function? 

Thanks, 

Tim

__
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] How do I create an object in the Global environment from a function

2006-12-14 Thread Timothy . Mak
Hi all, 

Say I have created an object b in my function 

myfunc - function() b - 34

How can I make b an object in the Global environment and not just in the 
environment of myfunc? 

Thanks, 

Tim

__
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] Stepwise regression

2006-12-14 Thread Timothy . Mak
Dear all, 

I am wondering why the step() procedure in R has the description 'Select a 
formula-based model by AIC'. 

I have been using Stata and SPSS and neither package made any reference to 
AIC in its stepwise procedure, and I read from an earlier R-Help post that 
step() is really the 'usual' way for doing stepwise (R Help post from Prof 
Ripley, Fri, 2 Apr 1999 05:06:03 +0100 (BST)). 

My understanding of the 'usual' way of doing say forward regression is 
that variables whose p value drops below a criterion (commonly 0.05) 
become candidates for being included in the model, and the one with the 
lowest p among these gets chosen, and the step is repeated until all p 
values not in the model are above 0.05, cf Hosmer and Lemeshow (1989) 
Applied Logistic Regression. The procedure does not require examination of 
the AIC. 

I am not well aquainted with R enough to understand the codes used in 
step(), so can somebody tell me how step() works?

Thanks very much, 

Tim

__
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] Stepwise regression

2006-12-14 Thread Timothy . Mak
Dear all, 

I am wondering why the step() procedure in R has the description 'Select a 
formula-based model by AIC'. 

I have been using Stata and SPSS and neither package made any reference to 
AIC in its stepwise procedure, and I read from an earlier R-Help post that 
step() is really the 'usual' way for doing stepwise (R Help post from Prof 
Ripley, Fri, 2 Apr 1999 05:06:03 +0100 (BST)). 

My understanding of the 'usual' way of doing say forward regression is 
that variables whose p value drops below a criterion (commonly 0.05) 
become candidates for being included in the model, and the one with the 
lowest p among these gets chosen, and the step is repeated until all p 
values not in the model are above 0.05, cf Hosmer and Lemeshow (1989) 
Applied Logistic Regression. The procedure does not require examination of 
the AIC. 

I am not well aquainted with R enough to understand the codes used in 
step(), so can somebody tell me how step() works?

Thanks very much, 

Tim

__
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] 2 questions

2006-12-12 Thread Timothy . Mak
Hi all, 

I'm new here. Want to ask two possibly quite basic questions: 

1. How can I clear all objects in one stroke? 
2. How can I perform a regression with independent variables specified by 
an object? 

Thanks, 

Tim

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