Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

makeCatModel

Make simple regression model with one categorical variable


Description

Make simple regression model with one categorical variable

Usage

makeCatModel(
  labels = labels,
  data,
  yvar = "Y",
  total = FALSE,
  addvars = TRUE,
  maxylev = 6,
  mode = 1
)

Arguments

labels

Named list of variables

data

A data.frame

yvar

Label of the dependent variable. Either "Y"(default) or "M".

total

logical. If true, model include mediator variable.

addvars

logical. Whether or not add categorical variables to the data

maxylev

maximal unique length of categorical variable

mode

Numeric. One of 1:4. 1= simple indicator coding, 2= sequential coding, 3= Helmert coding, 4= effect coding

Value

An object of class lm

Examples

labels=list(X="protest",W="sexism",M="respappr",Y="liking")
data1=addCatVars(protest,"protest")
makeCatModel(labels=labels,data=data1)

processR

Implementation of the 'PROCESS' Macro

v0.2.6
GPL-2
Authors
Keon-Woong Moon [aut, cre], Sokyoung Hong [ctb]
Initial release
2021-1-5

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.