I have several variables measured in different units (blood pressure, scales, heart rate), but all of them are an indicator of stress. I would like to combine them in a single model to try to predict stress
by some predictors such as age
.
df <- data.frame(stress=c(80,91,90,100 ,190,79,188,120, 3.2,3.3,1.4,4.5), variable=rep(c("blood_pressure","heart_rate","stress_scale"),each=4), age=c(30,42,40,53,55,45,34,43,32,22,25,54), ID=c("ID1","ID2","ID3","ID4","ID5","ID6","ID7","ID8","ID9","ID10","ID11","ID12"))
Because each of the measures have different units I cannot simply do
m <- lm(stress ~ variable*age, data=df)
My question is whether I can standardize stress
within each variable
:
blood_pressure_scaled = scale(df[df$variable=="blood_pressure","stress"])
heart_rate_scaled = scale(df[df$variable=="heart_rate","stress"])
stress_scale_scaled = scale(df[df$variable=="stress_scale","stress"])
df$variable_scaled = c(blood_pressure_scaled, heart_rate_scaled, stress_scale_scaled)
And then run this model?
m <- lm(stress ~ variable_scaled*age, data=df)
would this be appropriate?