sigmaSvm.test: Standard Deviation Calculation by Silverman's Rule (Tesing...

View source: R/sd_fcns.R

sigmaSvm.testR Documentation

Standard Deviation Calculation by Silverman's Rule (Tesing Version for Multi-dim)

Description

Standard deviation is calculated using Silverman's Rule, as in RDHonest::NPRPrelimVar.fit

Usage

sigmaSvm.test(Xt, Xc, Yt, Yc)

Arguments

Xt

n_t by k design matrix for the treated units.

Xc

n_c by k design matrix for the control units.

Yt

outcome value for the treated group observations.

Yc

outcome value for the control group observations.

Details

This works only for one-dimensional cases.

Value

a list containing conditional standard deviation estimates for treated observations (sigma.t) and control observations (sigma.c)

Examples

n <- 500
d <- 1
X <- matrix(rnorm(n * d), nrow = n, ncol = d)
tind <- X[, 1] < 0
Xt <- X[tind == 1, ,drop = FALSE]
Xc <- X[tind == 0, ,drop = FALSE]
sigma <- rep(1, n)
sigma_t <- sigma[tind == 1]
sigma_c <- sigma[tind == 0]
Yt = 1 + rnorm(length(sigma_t), mean = 0, sd = sigma_t)
Yc = rnorm(length(sigma_c), mean = 0, sd = sigma_c)
sigmaSvm.test(Xt, Xc, Yt, Yc)

koohyun-kwon/rdadapt documentation built on May 8, 2022, 8:49 p.m.