piecewiseSEM
piecewiseSEM copied to clipboard
using `scale` in model formula still not applying properly
eg
library(piecewiseSEM)
data <- data.frame(y= runif(100), x = runif(100))
model <- lm(y ~ x, data)
coefs(model)
model2 <- lm(scale(y) ~ scale(x), data)
coefs(model) # here estimate and std.estimate should be the same
Ok so this is also weird for interactions: i think the package takes the product and then scales, when it should scale each variable THEN take the product. At least, I think this is how it should work...
Actually, I think this is working as intended, see:
stdCoefs(model)
unstdCoefs(model2)
Also, running coefs(model2) gives a warning about the use of scale for response
So closing for now