Description Usage Arguments Examples
The SHG is written in Python and is maintained seperately from this package by CISNET. This function calls the SHG from within R, creates the SHG output_19X0.out file, and also returns the SHG cohort. The SHG needs to be installed properly prior to use. To use runSHG(), you pass it the directory where the SHG is installed. Tested using SHG6.3.4 and Python v2.7.10 on MacOSX. SHG6.3.4.zip was obtained from cisnet.flexkb.net, see their readme.md for setup instructions. In python, you'll likely want these dependencies: six, ipdb, enum, ipython_genutils, ipython. To install the SHG, run install.sh. To run the SHG from R, run: (1) python run_tests.py directly, or use this R wrapper function to create a custom 'run_custom_tests.py'. No object is returned by this wrapper function. You will be prompted to look for the appropriate output_19X0.out, input_19X0.txt, and errors_19X0.txt in the SHG directory. If you do not wish to use the SHG, you can load a processed smoking history dataset by typing: data(smkhist) that is included with this package. The smkhist dataset is for a 1950 birth cohort of 10000 men from SHG3.6.4.
1 | runSHG(path, n, gender, birth_cohort, seed)
|
path |
a string indicating the directory that the SHG is installed in (ie: "~/SHG6.3.4") |
n |
the size of the cohort (ie: 10000) |
gender |
the gender (ie: "M" == 0 or "F" == 1) |
birth_cohort |
the year of birth for the cohort (ie: 1950 or 1960) |
seed |
the seed for random number generator |
1 2 3 4 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.