apcomp: Average predictive comparisons

Description Usage Arguments Value

View source: R/function_apcomp.R

Description

Average predictive comparisons

Usage

1
apcomp(m, u, v = NULL, y_scale = NULL, u_scale = "identity", n_sim = 1000)

Arguments

m

model object. The function accepts model classes "lm", "rlm", "glm", "lmerMod", "glmerMod"

u

character string indicating input variable of interest.

v

character string indicating variables other than the input variable of interest. By default, the function uses all the variables except u.

y_scale

function transforming the scale of the response variable. If NULL (default), the function extracts an inverse link function from the model object m. Accepts either "log", "log10", "logit", or "identity".

u_scale

function transforming the scale of the input variable u. Accepts either "log", "log10", "logit", or "identity". Default "identity".

n_sim

number of simulations for estimating uncertainty of the average predictive comparison

Value

estimate point estimate of average predictive comparison

sim_estimate simulated estimate of average predictive comparison

sim_se standard error of simulated average predictive comparison

df_uv data frame of squared mahalanobis distance (sq_distance) with input values of u and v.

df_u1v1 data frame of u1 and v1.

df_u2v1 data frame of u2 and v1.

interaction_term interaction terms involving input u.


aterui/avpc documentation built on March 16, 2021, 12:05 a.m.