ncets_cat: Eliminating the Unmeasured Confounders and Estimating Causal...

Description Usage Arguments Value Examples

View source: R/ncetscat.R

Description

Eliminating the Unmeasured Confounders and Estimating Causal Effect for Categorical outcome.

Usage

1
2
3
4
5
6
7
ncets_cat(
  data = data,
  x1_name = "x1",
  x3_name = "x3",
  y_name = "y",
  boots_no = 1000
)

Arguments

data

an optional data frame containing the variables in the model.

x1_name

the name of pre-outcome exposure

x3_name

the name of post-outcome exposure

y_name

the name of outcome

boots_no

the number of bootstrap

Value

coefficient the casual effect coefficients and its 95

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
u1 <- rbinom(1000,1,0.5)
px1 <- exp(0.8*u1)/(1+exp(0.8*u1))
x1 <- apply(matrix(px1,nrow=1),2,rbinom,n=1,size=1)
px3 <- exp(0.8*u1)/(1+exp(0.8*u1))
x3 <- apply(matrix(px3,nrow=1),2,rbinom,n=1,size=1)
py<- 0.2*x1+0.4*u1
y<- apply(matrix(py,nrow=1),2,rbinom,n=1,size=1)

data <- data.frame(x1,x3,y)
model <- ncets_cat ( data = data,x1_name = 'x1',
x3_name = 'x3', y_name ='y',boots_no = 1000)
model

yuyy-shandong/NCETS documentation built on May 19, 2021, 10:32 p.m.