Learn R Programming

processR (version 0.2.7)

getYhat1: Get Yhat value from simple mediation

Description

Get Yhat value from simple mediation

Usage

getYhat1(
  data,
  X = NULL,
  M = NULL,
  Y = NULL,
  labels,
  digits = 3,
  maxylev = 6,
  mode = 1
)

Arguments

data

A data.frame

X

Name of independent variable

M

Name of moderator variable

Y

Name of dependant variable

labels

optional list of labels

digits

Integer indicating the number of decimal places

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

Examples

Run this code
data=protest
labels=list(X="protest",M="respappr",Y="liking")
getYhat1(data=protest,labels=labels)

Run the code above in your browser using DataLab