Skip to content

Commit d4809bb

Browse files
committed
Add data usage notice
1 parent 40e8e5f commit d4809bb

File tree

2 files changed

+35
-5
lines changed

2 files changed

+35
-5
lines changed

aif360/data/raw/meps/README.md

+14-4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@ The Medical Expenditure Panel Survey (MEPS) data consists of large scale surveys
1212
* [2016 full Year Consolidated Data File](https://meps.ahrq.gov/mepsweb/data_stats/download_data_files_detail.jsp?cboPufNumber=HC-192): : This file contains MEPS survey data for calendar year 2016 obtained in rounds 3, 4, and 5 of Panel 20, and rounds 1, 2, and 3 of Panel 21.
1313

1414

15+
## Data Use Agreement
16+
17+
As the user of the data it is your responsibility to read and abide by any copyright/usage rules and restrictions as
18+
stated on the MEPS web site before downloading the data.
19+
20+
- [Data Use Agreement (2015 Data File)](https://meps.ahrq.gov/data_stats/download_data/pufs/h181/h181doc.shtml#Data)
21+
- [Data Use Agreement (2016 Data File)](https://meps.ahrq.gov/data_stats/download_data/pufs/h192/h192doc.shtml#DataA)
22+
23+
1524
## Download instructions
1625

1726
In order to use the MEPS datasets with AIF360, please follow the following directions to download the datafiles and
@@ -21,13 +30,14 @@ Follow either set of instructions below for using R or SPSS. Further instruction
2130
the [AHRQ MEPS Github repository](https://github.com/HHS-AHRQ/MEPS).
2231

2332
- **Generating CSV files with R**
24-
25-
In the current folder run the R script `generate_data.R`. If you don't have R installed the easiest way to get the R
26-
command line support on Mac OS X is by installing it with [Homebrew](https://brew.sh/) `brew install R`.
33+
34+
In the current folder run the R script `generate_data.R`. R can be downloaded from [CRAN](https://cran.r-project.org).
35+
If you are working on Mac OS X the easiest way to get the R command line support is by installing it with
36+
[Homebrew](https://brew.sh/) `brew install R`.
2737

2838
```Bash
2939
cd aif360/data/raw/meps
30-
Rscript create_data.R
40+
Rscript generate_data.R
3141
```
3242

3343
Example output:

aif360/data/raw/meps/generate_data.R

+21-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
#!/usr/bin/env Rscript
22

3+
# This R script can be used to download the Medical Expenditure Panel Survey (MEPS)
4+
# data files for 2015 and 2016 and convert the files from SAS transport format into
5+
# standard CSV files.
6+
7+
usage_note <- paste("",
8+
"By using this script you acknowledge the responsibility for reading and",
9+
"abiding by any copyright/usage rules and restrictions as stated on the",
10+
"MEPS web site (https://meps.ahrq.gov/data_stats/data_use.jsp).",
11+
"",
12+
"Continue [y/n]? > ", sep = "\n")
13+
14+
cat(usage_note)
15+
answer <- scan("stdin", character(), n=1, quiet=TRUE)
16+
17+
if (tolower(answer) != 'y') {
18+
opt <- options(show.error.messages=FALSE)
19+
on.exit(options(opt))
20+
stop()
21+
}
22+
323
if (!require("foreign")) {
424
install.packages("foreign")
525
library(foreign)
@@ -20,7 +40,7 @@ for (dataset in c("h181", "h192")) {
2040

2141
# skip to next dataset if we already have the CSV file
2242
if (file.exists(csv_file)) {
23-
message(csv_file, " already exists")
43+
message(csv_file, " already exists")
2444
next
2545
}
2646

0 commit comments

Comments
 (0)