Skip to main content
replaced http://stats.stackexchange.com/ with https://stats.stackexchange.com/
Source Link

See http://stats.stackexchange.com/a/30884/70282https://stats.stackexchange.com/a/30884/70282, you'll notice you can divide or multiple by the std dev of the predictor variable to go back and forth.

Example:

d=data.frame(x1=runif(1000,10,20),
             x2=runif(1000,100,200),
             x3=runif(1000,0,100))
d$y=ifelse(d$x1>15 & d$x2>150 & d$x3>50,1,0)
summary(d)
d2=as.data.frame(scale(d))
d2$y=d$y
summary(m <- glm(y~.,d,family = 'binomial'))
summary(m2 <- glm(y~.,d2,family = 'binomial'))
coef(m) #metric coeff
coef(m2) #standarized coef
coef(m)*c(1,sd(d$x1),sd(d$x2),sd(d$x3)) #standardized from metric
coef(m2)/c(1,sd(d$x1),sd(d$x2),sd(d$x3)) #metric from standardized

As a function:

logistic.beta=function(m){
  coef(m)[-1]*sapply(m$data,sd)[names(coef(m))[-1]]
}

See http://stats.stackexchange.com/a/30884/70282, you'll notice you can divide or multiple by the std dev of the predictor variable to go back and forth.

Example:

d=data.frame(x1=runif(1000,10,20),
             x2=runif(1000,100,200),
             x3=runif(1000,0,100))
d$y=ifelse(d$x1>15 & d$x2>150 & d$x3>50,1,0)
summary(d)
d2=as.data.frame(scale(d))
d2$y=d$y
summary(m <- glm(y~.,d,family = 'binomial'))
summary(m2 <- glm(y~.,d2,family = 'binomial'))
coef(m) #metric coeff
coef(m2) #standarized coef
coef(m)*c(1,sd(d$x1),sd(d$x2),sd(d$x3)) #standardized from metric
coef(m2)/c(1,sd(d$x1),sd(d$x2),sd(d$x3)) #metric from standardized

As a function:

logistic.beta=function(m){
  coef(m)[-1]*sapply(m$data,sd)[names(coef(m))[-1]]
}

See https://stats.stackexchange.com/a/30884/70282, you'll notice you can divide or multiple by the std dev of the predictor variable to go back and forth.

Example:

d=data.frame(x1=runif(1000,10,20),
             x2=runif(1000,100,200),
             x3=runif(1000,0,100))
d$y=ifelse(d$x1>15 & d$x2>150 & d$x3>50,1,0)
summary(d)
d2=as.data.frame(scale(d))
d2$y=d$y
summary(m <- glm(y~.,d,family = 'binomial'))
summary(m2 <- glm(y~.,d2,family = 'binomial'))
coef(m) #metric coeff
coef(m2) #standarized coef
coef(m)*c(1,sd(d$x1),sd(d$x2),sd(d$x3)) #standardized from metric
coef(m2)/c(1,sd(d$x1),sd(d$x2),sd(d$x3)) #metric from standardized

As a function:

logistic.beta=function(m){
  coef(m)[-1]*sapply(m$data,sd)[names(coef(m))[-1]]
}
added 116 characters in body
Source Link
Chris
  • 1.3k
  • 10
  • 31

See http://stats.stackexchange.com/a/30884/70282, you'll notice you can divide or multiple by the std dev of the predictor variable to go back and forth.

Example:

d=data.frame(x1=runif(1000,10,20),
             x2=runif(1000,100,200),
             x3=runif(1000,0,100))
d$y=ifelse(d$x1>15 & d$x2>150 & d$x3>50,1,0)
summary(d)
d2=as.data.frame(scale(d))
d2$y=d$y
summary(m <- glm(y~.,d,family = 'binomial'))
summary(m2 <- glm(y~.,d2,family = 'binomial'))
coef(m) #metric coeff
coef(m2) #standarized coef
coef(m)*c(1,sd(d$x1),sd(d$x2),sd(d$x3)) #standardized from metric
coef(m2)/c(1,sd(d$x1),sd(d$x2),sd(d$x3)) #metric from standardized

As a function:

logistic.beta=function(m){
  coef(m)[-1]*sapply(m$data,sd)[names(coef(m))[-1]]
}

See http://stats.stackexchange.com/a/30884/70282, you'll notice you can divide or multiple by the std dev of the predictor variable to go back and forth.

Example:

d=data.frame(x1=runif(1000,10,20),
             x2=runif(1000,100,200),
             x3=runif(1000,0,100))
d$y=ifelse(d$x1>15 & d$x2>150 & d$x3>50,1,0)
summary(d)
d2=as.data.frame(scale(d))
d2$y=d$y
summary(m <- glm(y~.,d,family = 'binomial'))
summary(m2 <- glm(y~.,d2,family = 'binomial'))
coef(m) #metric coeff
coef(m2) #standarized coef
coef(m)*c(1,sd(d$x1),sd(d$x2),sd(d$x3)) #standardized from metric
coef(m2)/c(1,sd(d$x1),sd(d$x2),sd(d$x3)) #metric from standardized

See http://stats.stackexchange.com/a/30884/70282, you'll notice you can divide or multiple by the std dev of the predictor variable to go back and forth.

Example:

d=data.frame(x1=runif(1000,10,20),
             x2=runif(1000,100,200),
             x3=runif(1000,0,100))
d$y=ifelse(d$x1>15 & d$x2>150 & d$x3>50,1,0)
summary(d)
d2=as.data.frame(scale(d))
d2$y=d$y
summary(m <- glm(y~.,d,family = 'binomial'))
summary(m2 <- glm(y~.,d2,family = 'binomial'))
coef(m) #metric coeff
coef(m2) #standarized coef
coef(m)*c(1,sd(d$x1),sd(d$x2),sd(d$x3)) #standardized from metric
coef(m2)/c(1,sd(d$x1),sd(d$x2),sd(d$x3)) #metric from standardized

As a function:

logistic.beta=function(m){
  coef(m)[-1]*sapply(m$data,sd)[names(coef(m))[-1]]
}
Source Link
Chris
  • 1.3k
  • 10
  • 31

See http://stats.stackexchange.com/a/30884/70282, you'll notice you can divide or multiple by the std dev of the predictor variable to go back and forth.

Example:

d=data.frame(x1=runif(1000,10,20),
             x2=runif(1000,100,200),
             x3=runif(1000,0,100))
d$y=ifelse(d$x1>15 & d$x2>150 & d$x3>50,1,0)
summary(d)
d2=as.data.frame(scale(d))
d2$y=d$y
summary(m <- glm(y~.,d,family = 'binomial'))
summary(m2 <- glm(y~.,d2,family = 'binomial'))
coef(m) #metric coeff
coef(m2) #standarized coef
coef(m)*c(1,sd(d$x1),sd(d$x2),sd(d$x3)) #standardized from metric
coef(m2)/c(1,sd(d$x1),sd(d$x2),sd(d$x3)) #metric from standardized