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

Description Usage Arguments Value Examples

View source: R/ncetscon.R

Description

Eliminating the Unmeasured Confounders and Estimating Causal Effect for Continuous Outcome.

Usage

1
2
3
4
5
6
7
8
ncets_con(
  formula,
  data = data,
  sdmethod = c("normal", "bootstrap", "all"),
  x1_name = "x1",
  x3_name = "x3",
  boots_no = NULL
)

Arguments

formula

an object of class 'formula' : a symbolic description of the model to be fitted

data

an optional data frame containing the variables in the model.

sdmethod

Choosing a method for estimating variance

x1_name

the name of pre-outcome exposure

x3_name

the name of post-outcome exposure

boots_no

the number of bootstrap

Value

formula the model

bootstrap the casual effect coefficients when the variance is calculated by bootstrap

normal the casual effect coefficients when the variance is calculated in theory

quant the confidence interval calculated by bootstrap

Examples

1
2
3
4
5
6
7
8
  u <- rnorm(1000,0,1)
  x1 <- 0.5*u +rnorm(1000,0,1)
  x3 <- 0.5*u +rnorm(1000,0,1)
  y <- 2*x1 + 1*u +rnorm(1000,0,1)
  data <- data.frame(u,x1,x3,y)
  model <- ncets_con (y~x1+x3, data = data, sdmethod ='normal',
  x1_name = 'x1',x3_name = 'x3',boots_no = NULL)
  model

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