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
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(
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(
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
4 matches
Mail list logo