Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
4 changes: 2 additions & 2 deletions R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
#' data(Crime2009)
#' Crime2009[Crime2009$state == "Alabama", ]
#'
#' fit <- lm(violent ~ poverty + single, data = Crime2009)
#' fit <- lm(murder ~ hs_grad + poverty + single, data = Crime2009)
#' hcinfer(fit, type = "hcbeta")
#'
"Crime2009"
Expand Down Expand Up @@ -157,7 +157,7 @@
#' data(Hprice)
#' head(Hprice)
#'
#' fit <- lm(price ~ lotsize + sqrft + bdrms, data = Hprice)
#' fit <- lm(price ~ lotsize + bdrms + bdrms:sqrft, data = Hprice)
#' hcinfer(fit, type = "hcbeta")
#'
"Hprice"
2 changes: 1 addition & 1 deletion man/Crime2009.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/Hprice.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions vignettes/hcinfer-comparison.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ diagnostics.

## Fit one model

Comparisons should start from one fitted model. Here we use a house-price
regression and focus on the lot-size coefficient.
Comparisons should start from one fitted model. Here we use the Boston
house-price model from the HCbeta paper (price regressed on lot size, number of
bedrooms, and a bedrooms-by-size interaction) and focus on the lot-size
coefficient.

```{r}
library(hcinfer)

fit <- lm(price ~ lotsize + sqrft + bdrms, data = Hprice)
fit <- lm(price ~ lotsize + bdrms + bdrms:sqrft, data = Hprice)
```

## Run several methods
Expand Down
12 changes: 7 additions & 5 deletions vignettes/hcinfer-hcbeta.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ knitr::opts_chunk$set(
options(hcinfer.use_emoji = FALSE)
```

This vignette shows how to run HCbeta on the Crime2009 dataset, inspect its
method parameters and diagnostic quantities, and run a small sensitivity check
on its tuning controls. It assumes the introduction (`vignette("introduction",
package = "hcinfer")`).
This vignette shows how to run HCbeta on the `Crime2009` dataset, the 2009 U.S.
crime application from the HCbeta paper, which regresses the murder rate on
high-school graduation, poverty, and single-parent household rates. It inspects
HCbeta's method parameters and diagnostic quantities, and runs a small
sensitivity check on its tuning controls. It assumes the introduction
(`vignette("introduction", package = "hcinfer")`).

## Run HCbeta

Expand All @@ -29,7 +31,7 @@ default `hcinfer(fit)` call.
```{r run-hcbeta}
library(hcinfer)

fit <- lm(violent ~ hs_grad + poverty + single, data = Crime2009)
fit <- lm(murder ~ hs_grad + poverty + single, data = Crime2009)
result <- hcinfer(fit, type = "hcbeta")

summary(result)
Expand Down
Loading