Learn R Programming

ptools (version 2.0.0)

wdd_harm: Combines Multiple WDD Tests

Description

Combines multiple weighted displacement difference tests into one final weighted harm metric.

Usage

wdd_harm(est, se, weight, alpha = 0.1, silent = FALSE)

Value

A length 5 vector with names:

  • HarmEst, the combined harm estimate

  • SE_HarmEst its standard error

  • Z, the Z-score

  • and the lower and upper confidence intervals, LowCI and HighCI, for whatever alpha level you specified.

Arguments

est

vector with WDD estimates (e.g. difference in crime counts for treated vs controls)

se

vector with standard errors for WDD estimates

weight

vector with weights to aggregate results

alpha

scaler alpha level for confidence interval (default 0.1)

silent

boolean, do not print stat messages (default FALSE)

Details

This test combines multiple wdd estimates with different weights. Created to combine tests for crime harm weights.

See Also

wdd() for estimating the individual wdd outcomes

Examples

Run this code
# Creating wdd tests for three different crimes and combining
rob <- wdd(c(20,20),c(20,10))
burg <- wdd(c(30,30),c(25,20))
theft <- wdd(c(80,60),c(70,20))
dat = data.frame(rbind(rob,burg,theft))
# passing those columns now to the wdd_harm function
harm_weights <- c(10,5,1)
wdd_harm(dat$Est_Local,dat$SE_Local,harm_weights)

Run the code above in your browser using DataLab