Examples

The following table provides links to example code corresponding to selected examples from the book. In most cases both R and Stata code are provided. For advanced methods, BayesX code is provided in addition.

R-CodeStata-CodeBayesX-Code
Example 1.6 zambia_descriptive.do
Example 1.8 rent_correlation.do
Example 1.10 zambia_correlation1.do, zambia_correlation2.do
Example 2.18 rent_gamlss.R
Example 2.19 rent_gamlss.R
Example 3.5 rent_nonlinear_additive.R rent_nonlinear_additive.do
Example 3.13 rent_hypothesis.R rent_hypothesis.do
Example 3.19 golf_example3_19.R golf_regression1.do
Example 3.20 golf_example3_20.R golf_regression2.do
Example 3.21 golf_example3_21.Rgolf_regression3.do
Example 3.22 golf_regression4.do
Example 3.23 golf_example3_23.R golf_regression5.do
Example 3.24 golf_example3_24.R golf_regression_alternative.do
Example 4.1 example4_1.R rent_heteroscedasticity1.do
Example 4.2 rent_heteroscedasticity2.do
Example 4.3 rent_heteroscedasticity3.do
Example 4.5 golf_weighted_regression.do
Example 4.10 example4_10_11.R
Example 4.11 example4_10_11.R
Example 4.12 example4_12.R
Example 4.14 golflasso.txt , golfridge.txt
Example 4.15 golf_bma.R
Example 4.16 golf_bma.R
Example 5.1 patent_opp1.R patent_opp1.do
Example 5.4 patent_opp2.R patent_opp2.do
Example 5.6 patent_ncit.R patent_ncit.do
Example 5.7 patent_ncit.R patent_ncit.do
Example 5.9 patent.txt
Example 6.4 caesarian_mlogit.R caesarian_mlogit.do
Example 6.5 forest_beach_param.R forest_beach_param.do
Example 6.6 lungtest.R lungtest.txt
Example 6.7 caesarian_mlogit.R caesarian_mlogit.do
Example 7.7 speed.R speeddating.prg
Example 7.8 patent_mixedmodels.txt
Example 9.1 rent_additive.txt
Example 9.2 rent_geoadditive.txt
Example 9.3 rent_location_area.txt
Example 9.4 rent_interact.txt
Example 9.5 orangejuice_additive.txt
Example 9.7 forest.txt
Example 9.8 patent_additive.txt
Case study Sec. 9.8 zambia_descriptive_casestudy.do zambia_casestudy.txt
Example 10.1example10_1.R
Example 10.2example10_2.prg