Package 'efflog'

Title: The Causal Effects for a Causal Loglinear Model
Description: Fitting a causal loglinear model and calculating the causal effects for a causal loglinear model with the multiplicative interaction or without the multiplicative interaction, obtaining the natural direct, indirect and the total effect. It calculates also the cell effect, which is a new interaction effect.
Authors: Gloria Gheno [aut, cre]
Maintainer: Gloria Gheno <[email protected]>
License: GPL (>= 2)
Version: 1.0
Built: 2024-11-18 05:39:03 UTC
Source: https://github.com/cran/efflog

Help Index


The Causal Effects for a Causal Loglinear Model

Description

Calculate the Causal Effects for a causal loglinear model with the multiplicative interaction or without the multiplicative interaction

Details

Package: efflog
Type: Package
Version: 1.0
Date: 2015-07-14
License: GPL (>=2)

Author(s)

Gloria Gheno <[email protected]>

References

Gheno Gloria (2015), The causal analysis in the loglinear model


Cell effect for loglinear models with the multiplicative interaction

Description

This function calculates the cell effect using the odds ratio for a loglinear model with the multiplicative interaction and under dummy code parametrization

Usage

cell_effect_mult_or(x, y, z, w, q)

Arguments

x

it is the parameter μY=1\mu^{Y=1}

y

it is the parameter μX=1,Y=1\mu^{X=1,Y=1}

z

it is the parameter μZ=1,Y=1\mu^{Z=1, Y=1}

w

it is the parameter μcZ=1\mu_c^{Z=1}

q

it is the parameter μX=1,Z=1,Y=1\mu^{X=1,Z=1,Y=1}

Value

cell_effect_mult_or returns the cell effect

Author(s)

Gloria Gheno

References

Gheno Gloria (2015),The causal analysis in the loglinear model

Examples

cell_effect_mult_or(0.6,0.8,0.5,2,0.6)

Cell effect for loglinear models without the multiplicative interaction

Description

This function calculates the cell effect using the odds ratio for a loglinear model without the multiplicative interaction and under dummy code parametrization

Usage

cell_effect_or(x, y, z, w)

Arguments

x

it is the parameter μY=1\mu^{Y=1}

y

it is the parameter μX=1,Y=1\mu^{X=1,Y=1}

z

it is the parameter μZ=1,Y=1\mu^{Z=1, Y=1}

w

it is the parameter μcZ=1\mu_c^{Z=1}

Value

cell_effect_or returns the cell effect

Author(s)

Gloria Gheno

References

Gheno Gloria (2015),The causal analysis in the loglinear model

Examples

cell_effect_or(0.6,0.8,0.5,2)

Fitting a causal log-linear model without the multiplicative interaction

Description

Cloglin is used to fit causal log-linear models under dummy code parametrization

Usage

Cloglin(table)

Arguments

table

it is a table containing the frequency distribution of the variables

Value

Cloglin returns the estimated causal parameters of the additive form, their standard errors and their p-values which test the null hypothesis H_0: parameter=0.

Author(s)

Gloria Gheno

References

Gheno Gloria (2015), The causal analysis in the loglinear model

Examples

tableXZY<-data.frame(expand.grid( 
X=factor(c("0","1"),levels=c("0","1")), 
Z=factor(c("0","1"),levels=c("0","1")), 
Y=factor(c("0","1"),levels=c("0","1"))), 
count=c(57,47,21,39,31,40,20,95))
Cloglin(tableXZY)

Fitting a causal log-linear model with the multiplicative interaction

Description

Cloglin_mult is used to fit causal log-linear models and under dummy code parametrization

Usage

Cloglin_mult(table)

Arguments

table

it is a table containing the frequency distribution of the variables

Value

Cloglin_mult returns the estimated causal parameters of the additive form, their standard errors and their p-values which test the null hypothesis H_0: parameter=0.

Author(s)

Gloria Gheno

References

Gheno Gloria (2015), The causal analysis in the loglinear model

Examples

tableXZY<-data.frame(expand.grid( 
 X=factor(c("0","1"),levels=c("0","1")), 
  Z=factor(c("0","1"),levels=c("0","1")), 
  Y=factor(c("0","1"),levels=c("0","1"))), 
  count=c(57,47,21,39,31,40,20,95))
Cloglin_mult(tableXZY)

Fitting causal log-linear models without the multiplicative interaction

Description

exp_par calculates the causal parameters for a causal log-linear model under dummy code parametrization

Usage

exp_par(table)

Arguments

table

it is a table containing the frequency distribution of the variables

Value

exp_par returns the estimated causal parameters of the multiplicative form

Author(s)

Gloria Gheno

References

Gheno Gloria (2015), The causal analysis in the loglinear model

Examples

tableXZY<-data.frame(expand.grid( 
 X=factor(c("0","1"),levels=c("0","1")), 
 Z=factor(c("0","1"),levels=c("0","1")), 
  Y=factor(c("0","1"),levels=c("0","1"))), 
 count=c(57,47,21,39,31,40,20,95))
exp_par(tableXZY)

Fitting causal log-linear model

Description

exp_par_mult calculates the causal parameters for a causal log-linear model with the multiplicative interaction

Usage

exp_par_mult(table)

Arguments

table

it is a table containing the frequency distribution of the variables

Value

exp_par_mult returns the estimated causal parameters of the multiplicative form

Author(s)

Gloria Gheno

References

Gheno Gloria (2015), The causal analysis in the loglinear model

Examples

tableXZY<-data.frame(expand.grid( 
 X=factor(c("0","1"),levels=c("0","1")), 
  Z=factor(c("0","1"),levels=c("0","1")), 
 Y=factor(c("0","1"),levels=c("0","1"))), 
 count=c(57,47,21,39,31,40,20,95))
exp_par_mult(tableXZY)

Indirect effect for loglinear models both with the multiplicative interaction and without it

Description

This function calculates the indirect effect using the odds ratio for any loglinear model and under dummy code parametrization

Usage

indirect_effect_or(x, y, z, w, t)

Arguments

x

it is the parameter μY=1\mu^{Y=1}

y

it is the parameter μX=1,Y=1\mu^{X=1,Y=1}

z

it is the parameter μZ=1,Y=1\mu^{Z=1, Y=1}

w

it is the parameter μcZ=1\mu_c^{Z=1}

t

it is the parameter μcX=1,Z=1\mu_c^{X=1,Z=1}

Value

indirect_effect_or returns the indirect effect

Author(s)

Gloria Gheno

References

Gheno Gloria (2015),The causal analysis in the loglinear model

Examples

indirect_effect_or(0.6,0.8,0.5,2,0.7)

Natural direct effect for loglinear models with the multiplicative interaction

Description

This function calculates the natural direct effect using the odds ratio for a loglinear model with the multiplicative interaction and under dummy code parametrization

Usage

ndirect_effect_mult_or(x, y, z, w, t, q)

Arguments

x

it is the parameter μY=1\mu^{Y=1}

y

it is the parameter μX=1,Y=1\mu^{X=1,Y=1}

z

it is the parameter μZ=1,Y=1\mu^{Z=1, Y=1}

w

it is the parameter μcZ=1\mu_c^{Z=1}

t

it is the parameter μcX=1,Z=1\mu_c^{X=1,Z=1}

q

it is the parameter μX=1,Z=1,Y=1\mu^{X=1,Z=1,Y=1}

Value

ndirect_effect_mult_or returns the natural direct effect

Author(s)

Gloria Gheno

References

Gheno Gloria (2015),The causal analysis in the loglinear model

Examples

ndirect_effect_mult_or(0.6,0.8,0.5,2,0.7,0.6)

Natural direct effect for loglinear models without the multiplicative interaction

Description

This function calculates the natural direct effect using the odds ratio for a loglinear model without the multiplicative interaction and under dummy code parametrization

Usage

ndirect_effect_or(x, y, z, w, t)

Arguments

x

it is the parameter μY=1\mu^{Y=1}

y

it is the parameter μX=1,Y=1\mu^{X=1,Y=1}

z

it is the parameter μZ=1,Y=1\mu^{Z=1, Y=1}

w

it is the parameter μcZ=1\mu_c^{Z=1}

t

it is the parameter μcX=1,Z=1\mu_c^{X=1,Z=1}

Value

ndirect_effect_or returns the natural direct effect

Author(s)

Gloria Gheno

References

Gheno Gloria (2015),The causal analysis in the loglinear model

Examples

#> ndirect_effect_or(0.6,0.8,0.5,2,0.7) 
#[1] 0.8039409

Total effect for loglinear models with the multiplicative interaction

Description

This function calculates the total effect using the odds ratio for a loglinear model with the multiplicative interaction and under dummy code parametrization

Usage

total_effect_mult_or(x, y, z, w, t, q)

Arguments

x

it is the parameter μY=1\mu^{Y=1}

y

it is the parameter μX=1,Y=1\mu^{X=1,Y=1}

z

it is the parameter μZ=1,Y=1\mu^{Z=1, Y=1}

w

it is the parameter μcZ=1\mu_c^{Z=1}

t

it is the parameter μcX=1,Z=1\mu_c^{X=1,Z=1}

q

it is the parameter μX=1,Z=1,Y=1\mu^{X=1,Z=1,Y=1}

Value

total_effect_mult_or returns the total effect

Author(s)

Gloria Gheno

References

Gheno Gloria (2015),The causal analysis in the loglinear model

Examples

total_effect_mult_or(0.6,0.8,0.5,2,0.7,0.6)

Total effect for loglinear models without the multiplicative interaction

Description

This function calculates the total effect using the odds ratio for a loglinear model without the multiplicative interaction and under dummy code parametrization

Usage

total_effect_or(x, y, z, w, t)

Arguments

x

it is the parameter μY=1\mu^{Y=1}

y

it is the parameter μX=1,Y=1\mu^{X=1,Y=1}

z

it is the parameter μZ=1,Y=1\mu^{Z=1, Y=1}

w

it is the parameter μcZ=1\mu_c^{Z=1}

t

it is the parameter μcX=1,Z=1\mu_c^{X=1,Z=1}

Value

total_effect_or returns the total effect

Author(s)

Gloria Gheno

References

Gheno Gloria (2015),The causal analysis in the loglinear model

Examples

total_effect_or(0.6,0.8,0.5,2,0.7)