Added code for weighted regression - I was not sure the best way to deal with SD - so I imputed them in two ways - the first just uses the pooled SD within Age class and the second uses truncated rnorm.
If you have sd then we can replace those in the model.
Added code for weighted regression - I was not sure the best way to deal with SD - so I imputed them in two ways - the first just uses the pooled SD within Age class and the second uses truncated rnorm.
If you have sd then we can replace those in the model.