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 |
Calculate the Causal Effects for a causal loglinear model with the multiplicative interaction or without the multiplicative interaction
Package: | efflog |
Type: | Package |
Version: | 1.0 |
Date: | 2015-07-14 |
License: | GPL (>=2) |
Gloria Gheno <[email protected]>
Gheno Gloria (2015), The causal analysis in the loglinear model
This function calculates the cell effect using the odds ratio for a loglinear model with the multiplicative interaction and under dummy code parametrization
cell_effect_mult_or(x, y, z, w, q)
cell_effect_mult_or(x, y, z, w, q)
x |
it is the parameter |
y |
it is the parameter |
z |
it is the parameter |
w |
it is the parameter |
q |
it is the parameter |
cell_effect_mult_or returns the cell effect
Gloria Gheno
Gheno Gloria (2015),The causal analysis in the loglinear model
cell_effect_mult_or(0.6,0.8,0.5,2,0.6)
cell_effect_mult_or(0.6,0.8,0.5,2,0.6)
This function calculates the cell effect using the odds ratio for a loglinear model without the multiplicative interaction and under dummy code parametrization
cell_effect_or(x, y, z, w)
cell_effect_or(x, y, z, w)
x |
it is the parameter |
y |
it is the parameter |
z |
it is the parameter |
w |
it is the parameter |
cell_effect_or returns the cell effect
Gloria Gheno
Gheno Gloria (2015),The causal analysis in the loglinear model
cell_effect_or(0.6,0.8,0.5,2)
cell_effect_or(0.6,0.8,0.5,2)
Cloglin is used to fit causal log-linear models under dummy code parametrization
Cloglin(table)
Cloglin(table)
table |
it is a table containing the frequency distribution of the variables |
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.
Gloria Gheno
Gheno Gloria (2015), The causal analysis in the loglinear model
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)
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)
Cloglin_mult is used to fit causal log-linear models and under dummy code parametrization
Cloglin_mult(table)
Cloglin_mult(table)
table |
it is a table containing the frequency distribution of the variables |
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.
Gloria Gheno
Gheno Gloria (2015), The causal analysis in the loglinear model
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)
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)
exp_par calculates the causal parameters for a causal log-linear model under dummy code parametrization
exp_par(table)
exp_par(table)
table |
it is a table containing the frequency distribution of the variables |
exp_par returns the estimated causal parameters of the multiplicative form
Gloria Gheno
Gheno Gloria (2015), The causal analysis in the loglinear model
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)
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)
exp_par_mult calculates the causal parameters for a causal log-linear model with the multiplicative interaction
exp_par_mult(table)
exp_par_mult(table)
table |
it is a table containing the frequency distribution of the variables |
exp_par_mult returns the estimated causal parameters of the multiplicative form
Gloria Gheno
Gheno Gloria (2015), The causal analysis in the loglinear model
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)
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)
This function calculates the indirect effect using the odds ratio for any loglinear model and under dummy code parametrization
indirect_effect_or(x, y, z, w, t)
indirect_effect_or(x, y, z, w, t)
x |
it is the parameter |
y |
it is the parameter |
z |
it is the parameter |
w |
it is the parameter |
t |
it is the parameter |
indirect_effect_or returns the indirect effect
Gloria Gheno
Gheno Gloria (2015),The causal analysis in the loglinear model
indirect_effect_or(0.6,0.8,0.5,2,0.7)
indirect_effect_or(0.6,0.8,0.5,2,0.7)
This function calculates the natural direct effect using the odds ratio for a loglinear model with the multiplicative interaction and under dummy code parametrization
ndirect_effect_mult_or(x, y, z, w, t, q)
ndirect_effect_mult_or(x, y, z, w, t, q)
x |
it is the parameter |
y |
it is the parameter |
z |
it is the parameter |
w |
it is the parameter |
t |
it is the parameter |
q |
it is the parameter |
ndirect_effect_mult_or returns the natural direct effect
Gloria Gheno
Gheno Gloria (2015),The causal analysis in the loglinear model
ndirect_effect_mult_or(0.6,0.8,0.5,2,0.7,0.6)
ndirect_effect_mult_or(0.6,0.8,0.5,2,0.7,0.6)
This function calculates the natural direct effect using the odds ratio for a loglinear model without the multiplicative interaction and under dummy code parametrization
ndirect_effect_or(x, y, z, w, t)
ndirect_effect_or(x, y, z, w, t)
x |
it is the parameter |
y |
it is the parameter |
z |
it is the parameter |
w |
it is the parameter |
t |
it is the parameter |
ndirect_effect_or returns the natural direct effect
Gloria Gheno
Gheno Gloria (2015),The causal analysis in the loglinear model
#> ndirect_effect_or(0.6,0.8,0.5,2,0.7) #[1] 0.8039409
#> ndirect_effect_or(0.6,0.8,0.5,2,0.7) #[1] 0.8039409
This function calculates the total effect using the odds ratio for a loglinear model with the multiplicative interaction and under dummy code parametrization
total_effect_mult_or(x, y, z, w, t, q)
total_effect_mult_or(x, y, z, w, t, q)
x |
it is the parameter |
y |
it is the parameter |
z |
it is the parameter |
w |
it is the parameter |
t |
it is the parameter |
q |
it is the parameter |
total_effect_mult_or returns the total effect
Gloria Gheno
Gheno Gloria (2015),The causal analysis in the loglinear model
total_effect_mult_or(0.6,0.8,0.5,2,0.7,0.6)
total_effect_mult_or(0.6,0.8,0.5,2,0.7,0.6)
This function calculates the total effect using the odds ratio for a loglinear model without the multiplicative interaction and under dummy code parametrization
total_effect_or(x, y, z, w, t)
total_effect_or(x, y, z, w, t)
x |
it is the parameter |
y |
it is the parameter |
z |
it is the parameter |
w |
it is the parameter |
t |
it is the parameter |
total_effect_or returns the total effect
Gloria Gheno
Gheno Gloria (2015),The causal analysis in the loglinear model
total_effect_or(0.6,0.8,0.5,2,0.7)
total_effect_or(0.6,0.8,0.5,2,0.7)