agg_lm: Fitting Linear Models with Aggregated Data

Description Usage Value See Also

Description

agg_lm is used to fit a linear regression model when the data are in aggregated form. That is, each unique combination of the covariates is assigned an integer count that is passed to the weights argument. It is useful for data that has been aggregated with a GROUP BY <list of variables> clause in an SQL query. It is designed to imitate the lm function, with appropriate adjustments for the sample size of the original un-aggregated data. Aside from the weights argument being mandatory, the arguments are identical to those in lm.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
agg_lm(
  formula,
  data,
  subset,
  weights,
  na.action,
  method = "qr",
  model = TRUE,
  x = FALSE,
  y = FALSE,
  y_squared = NULL,
  qr = TRUE,
  singular.ok = TRUE,
  contrasts = NULL,
  offset,
  ...
)

Value

agg_lm returns an object of class "agg_lm", the analogue for an object of class "lm", except with aggregated data.

See Also

lm function in the stats library. summary_agg_lm for summaries of objects in class "agg_lm".


LeeMorinUCF/aggregress documentation built on June 30, 2020, 5:06 a.m.