Skip to content

Commit

Permalink
don't actually run python
Browse files Browse the repository at this point in the history
  • Loading branch information
lukesonnet committed Feb 12, 2018
1 parent 8cc1986 commit 05c5d5c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 36 deletions.
3 changes: 1 addition & 2 deletions .Rbuildignore
Expand Up @@ -15,14 +15,13 @@ _pkgdown.yml
update_repo.R
^data-raw$
^_pkgdown\.yml$
^estimatr_.*\.tar\.gz$
^tests/testthat/mtcars\.csv$
^tests/testthat/run-stata-models\.do$
^tests/testthat/test-broom\.R$
^estimatr_.*\.tar\.gz$
^tests/testthat/test-texreg\.R$
^cran-comments\.md$
^vignettes/simulations-ols-variance\.Rmd$
^vignettes/simulations-debiasing-dim\.Rmd$
^vignettes/simulations.*\.rda$
^vignettes/stata-wls-hat\.Rmd$
^vignettes/mtcars\.csv$
33 changes: 0 additions & 33 deletions vignettes/mtcars.csv

This file was deleted.

5 changes: 4 additions & 1 deletion vignettes/stata-wls-hat.Rmd
Expand Up @@ -118,12 +118,15 @@ lm_robust(
```

We can also see that Python's [`statsmodels`](http://www.statsmodels.org/stable/index.html) provides the same results as the methods in R (and in fact they note the difference in an [issue on GitHub](https://github.com/statsmodels/statsmodels/issues/1209)).
```{python, python.reticulate=FALSE}
```{python, python.reticulate=FALSE, eval = FALSE}
import statsmodels.api as sm
import pandas as pd
dat = pd.read_csv('mtcars.csv')
wls_mod = sm.WLS(dat['mpg'], sm.add_constant(dat['hp']), weights = dat['wt'])
print(wls_mod.fit().HC2_se)
#> const 2.162818
#> hp 0.014457
#> dtype: float64
```

If we do the same in Stata 13, we get the following output:
Expand Down

0 comments on commit 05c5d5c

Please sign in to comment.