um.test1 | R Documentation |
This function tests the difference of various types of effects within
one single estimation object from function FormalEstmed
. It
is used to compare whether an effect is distinct from another.
um.test1 (obj, scale = "RD",type = c("PNDE", "TNIE"), Cf_lv=0.95, verbose=TRUE)
obj |
a resulting object of class |
scale |
a character variable of the effect scales. It can be |
type |
a character variable of the effect types, containing more than two.
The default is |
Cf_lv |
a numeric variable of the confident interval. The default is 0.95. |
verbose |
a logical value indicating whether the output is display. The default is TRUE. This is a standard parameter required by CRAN. |
No return value, called for displaying the output of the test result.
# Running formal estimation
data(testdata)
med_model=glm(med~exp+C1+C2+C3, data=testdata, family=binomial) # Fitting mediator's model
out_model=lm(out~med*exp+C1+C2+C3, data=testdata) # Fitting outcome's model
r1 = FormalEstmed (med_model=med_model, out_model=out_model,
data=testdata, exposure = "exp") # Running formal estimation
# Test examples
um.test1(r1) # Test of the default settings (PNDE v.s. TNIE on RD scales).
um.test1(r1,"OR") # Test of PNDE v.s. TNIE on OR scales.
# Test of PNDE v.s. TNIE on RD and OR scales:
um.test1(r1,c("RD", "OR"))
# Test of PNDE v.s. TNIE v.s. TE on RD and OR scales:
um.test1(r1,c("RD", "OR"), c("PNDE", "TNIE", "TE"))
# Test of PNDE v.s. TNIE v.s. TE on RD, OR and RR scales:
um.test1(r1, scale=c("RD", "OR", "RR"), type=c("PNDE", "TNIE", "TE"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.