In R, "family" is a parameter used in regression modeling functions to specify the probability distribution of the response variable. This distribution is used to fit the model and make predictions.
The "family" parameter is typically set to an object from the family
function, which contains information about the distribution of the response variable. For example, the gaussian()
family is used for linear regression, while the binomial()
family is used for logistic regression.
Here is an example of how to specify the family in a linear regression using the lm()
function in R:
main.r200 chars10 lines
This code will fit a linear regression model with a Gaussian (normal) distribution for the response variable y
and the predictor variable x
. The summary()
function provides a summary of the fitted model, including the estimated coefficients and their standard errors.
gistlibby LogSnag