regress.with: Regression with Grouping Variable

View source: R/dthelper-computation-functions.R

regress.withR Documentation

Regression with Grouping Variable

Description

Perform separate regressions for each unique group

Usage

regress.with(
  form,
  df,
  group,
  output = c("Estimate", "Std. Error", "t value", "Pr(>|t|)"),
  dp = 2
)

Arguments

form

Input formulae as string

df

data.frame object

group

Grouping variable. If specified, correlation will be performed within each group separately

output

Desired statistical output. Set to "Estimate", "Std. Error", "t value", or "Pr(>|t|)"

dp

Percentage of missing data will be reported. dp allows re-specification of number of decimal places

Value

data.frame object

Examples

library(car)
regress.with("mpg ~ wt + cyl",group="am", mtcars, output = "Estimate")
regress.with("mpg ~ wt + cyl",group="am", mtcars, output = 2) # standard error


dennisteowh/dthelper documentation built on March 19, 2022, 11:42 a.m.