Create a list containing the parameters of a fitted linear regression model.
params_lm(coefs, sigma =1)
Arguments
coefs: Samples of the coefficients under sampling uncertainty. Must be a matrix or any object coercible to a matrix such as data.frame
or data.table.
sigma: A vector of samples of the standard error of the regression model. Default value is 1 for all samples. Only used if the model is used to randomly simulate values (rather than to predict means).
Returns
An object of class params_lm, which is a list containing coefs, sigma, and n_samples. n_samples is equal to the number of rows in coefs. The coefs element is always converted into a matrix.
Details
Fitted linear models are used to predict values, y, as a function of covariates, x,
y=xTβ+ϵ.
Predicted means are given by xTβ^ where β^
is the vector of estimated regression coefficients. Random samples are obtained by sampling the error term from a normal distribution, ϵN(0,σ^2).
This parameter object is useful for modeling health state values
when values can vary across patients and/or health states as a function of covariates. In many cases it will, however, be simpler, and more flexible to use a stateval_tbl. For an example use case see the documentation for create_StateVals.lm().