Re: [R] Using a data frame in a function call

2007-10-23 Thread Charles C. Berry
On Tue, 23 Oct 2007, Peter Tait wrote: > Hi, > > I am writing a basic function to extract the z scores for some linear > regression coefficients: > > zscore<-function( y, x) { > lm<-lm( y ~ x ) > z <- coef(lm)/sqrt(diag(vcov(lm))) > return(z) > } > > I would like to pass a dataframe to the func

Re: [R] Using a data frame in a function call

2007-10-23 Thread Henrique Dallazuanna
I'm sorry: zscore<-function(x, y,...) { lm<-lm( y ~ x , ...) z <- coef(lm)/sqrt(diag(vcov(lm))) return(z) } zscore(x, y, data=df) On 23/10/2007, Henrique Dallazuanna <[EMAIL PROTECTED]> wrote: > > HI, > > Perhaps: > zscore<-function(x, y, data) { > lm<-lm( y ~ x , ...) > z <- coef(lm)/sqrt(

Re: [R] Using a data frame in a function call

2007-10-23 Thread Henrique Dallazuanna
HI, Perhaps: zscore<-function(x, y, data) { lm<-lm( y ~ x , ...) z <- coef(lm)/sqrt(diag(vcov(lm))) return(z) } On 23/10/2007, Peter Tait <[EMAIL PROTECTED]> wrote: > > Hi, > > I am writing a basic function to extract the z scores for some linear > regression coefficients: > > zscore<-function(

[R] Using a data frame in a function call

2007-10-23 Thread Peter Tait
Hi, I am writing a basic function to extract the z scores for some linear regression coefficients: zscore<-function( y, x) { lm<-lm( y ~ x ) z <- coef(lm)/sqrt(diag(vcov(lm))) return(z) } I would like to pass a dataframe to the function as a argument so the function call changes from zs