mod <- mod_norm(value ~ diag:age + year,
data = nld_expenditure,
weights = 1)
## use formula to specify weights
mod <- mod_norm(value ~ diag:age + year,
data = nld_expenditure,
weights = ~sqrt(value))
## but formulas are now deprecrated, and the
## recommended approach is to transform
## the input data outside the model:
nld_expenditure$wt <- sqrt(nld_expenditure$value)
mod <- mod_norm(value ~ diag:age + year,
data = nld_expenditure,
weights = wt)
Run the code above in your browser using DataLab