Learn R Programming

cosa (version 2.0.0)

inspect.score: Inspects Relations between Treatment, Score and Score^2 Triad

Description

Inpects relations between Treatment, Score and Score^2 triad, outputs correlations and design effects for linear and linear + quadratic functional forms for the score variable.

Usage

inspect.score(score = NULL, sim = FALSE, p = NULL, cutoff = NULL, treat.lower = FALSE,
                          mu = 0, sigma = 1, k1 = -1e+10, k2 =  1e+10,
                          dists = "normal", ndraw = 1000, nsim = 1000)

Arguments

sim

logical; if TRUE results are based on simulation.

score

vector; score variable.

p

proportion of units in treatment condition.

cutoff

cutoff.

treat.lower

logical; if TRUE subjects below cutoff are treated.

mu

mean of truncated normal - applies when score = NULL and dists = "normal".

sigma

standard deviation of truncated normal - applies when score = NULL and dists = "normal".

k1

left truncation point for empirical, truncated normal, or uniform distribution.

k2

right truncation point for empirical, truncated normal, or uniform distribution.

dists

char; type of distribution, "normal" or "uniform".

ndraw

number of draws - applies when sim = TRUE.

nsim

number of simulations - applies when sim = TRUE.

Value

parms

list; list of parameters used in the computation.

cutoff

cutoff score (computed if p is provided).

treat.lower

logical; not used very much but may be utilized in the future.

p

proportion of subjects treated (computed if cutoff is provided).

rhots

correlation between Treatment and Score.

rhots2

correlation between Treatment and Score^2.

rhoss2

correlation between Score and Score^2.

d1

design effect for linear functional form.

d2

design effect for linear + quadratic functional form.

Examples

Run this code
# NOT RUN {
  inspect.score(score = rnorm(10000), p = .50)

  # default based on ~ N(0,1)
  inspect.score(p = .50)
  inspect.score(sim = TRUE, p = .50)
# }

Run the code above in your browser using DataLab