mirror of
https://github.com/dwinkler1/fran.git
synced 2026-02-19 22:50:59 -05:00
Better testing
This commit is contained in:
parent
07623baadb
commit
5160c403b5
2 changed files with 22 additions and 0 deletions
1
.github/workflows/check.yml
vendored
1
.github/workflows/check.yml
vendored
|
|
@ -6,6 +6,7 @@ on:
|
||||||
- 'flake.lock'
|
- 'flake.lock'
|
||||||
- 'versions/*.json'
|
- 'versions/*.json'
|
||||||
- '.github/workflows/*.yml'
|
- '.github/workflows/*.yml'
|
||||||
|
- 'test/*.R'
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
|
||||||
21
test/test.R
21
test/test.R
|
|
@ -1,14 +1,35 @@
|
||||||
|
cat("Testing\n")
|
||||||
|
cat("\n============================================================ fwildclusterboot ============================================================\n")
|
||||||
|
library(fwildclusterboot)
|
||||||
|
data(voters)
|
||||||
|
lm_fit <- lm(
|
||||||
|
proposition_vote ~ treatment + ideology1 + log_income + Q1_immigration ,
|
||||||
|
data = voters
|
||||||
|
)
|
||||||
|
boot_lm <- boottest(
|
||||||
|
lm_fit,
|
||||||
|
clustid = "group_id1",
|
||||||
|
param = "treatment",
|
||||||
|
B = 999
|
||||||
|
)
|
||||||
|
summary(boot_lm)
|
||||||
|
|
||||||
|
cat("\n============================================================ httpgd ============================================================\n")
|
||||||
library(httpgd)
|
library(httpgd)
|
||||||
hgd()
|
hgd()
|
||||||
|
|
||||||
|
cat("\n============================================================ musicMetadata ============================================================\n")
|
||||||
library(musicMetadata)
|
library(musicMetadata)
|
||||||
print(classify_labels('Interscope'))
|
print(classify_labels('Interscope'))
|
||||||
|
|
||||||
|
cat("\n============================================================ nvimcom ============================================================\n")
|
||||||
library(nvimcom)
|
library(nvimcom)
|
||||||
|
|
||||||
|
cat("\n============================================================ synthdid ============================================================\n")
|
||||||
library(synthdid)
|
library(synthdid)
|
||||||
data('california_prop99')
|
data('california_prop99')
|
||||||
setup = panel.matrices(california_prop99)
|
setup = panel.matrices(california_prop99)
|
||||||
tau.hat = synthdid_estimate(setup$Y, setup$N0, setup$T0)
|
tau.hat = synthdid_estimate(setup$Y, setup$N0, setup$T0)
|
||||||
se = sqrt(vcov(tau.hat, method='placebo'))
|
se = sqrt(vcov(tau.hat, method='placebo'))
|
||||||
sprintf('95%% CI (%1.2f, %1.2f)', tau.hat - 1.96 * se, tau.hat + 1.96 * se)
|
sprintf('95%% CI (%1.2f, %1.2f)', tau.hat - 1.96 * se, tau.hat + 1.96 * se)
|
||||||
|
cat("\n============================================================ END ============================================================\n")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue