reg: Build regression models

View source: R/reg.R

regR Documentation

Build regression models

Description

Build general linear model, generalized linear model, cox regression model with one or more dependent variables. Allow regression based on subgroup variables.

Usage

reg(
  data = NULL,
  x = NULL,
  y = NULL,
  group = NULL,
  cov = NULL,
  factors = NULL,
  model = NULL,
  time = NULL,
  cov_show = FALSE,
  group_combine = FALSE
)

Arguments

data

A data.frame to build the regression model.

x

Integer column indices or names of the variables to be included in univariate analysis. If NULL, the default columns are all the variables except 'y', 'time' and 'cov'.

y

Integer column indice or name of dependent variables, integer or character, allow more than one dependent variables

group

Integer column indice or name of subgroup variables.

cov

Integer column indices or name of covariate variables

factors

Integer column indices or names of variables to be treated as factor

model

regression model, see lm, glm, coxph for more details

time

Integer column indices or name of survival time, used in cox regression, see coxph for more details

cov_show

A logical, whether to create covariates result, default FALSE

group_combine

A logical, subgroup analysis for combination of group variables or each group variables. The default is FALSE (subgroup analysis for each group variable)

Value

The return result is a concentrated result in a data.frame.


XikunHan/quickReg documentation built on March 21, 2022, 3:29 p.m.