Description Usage Arguments Value Examples
View source: R/utility_functions.R
Generate the X->Y pair HCR data
1 2 | simuXY(sample_size = 2000, min_nx = 3, max_nx = 15, min_ny = 3,
max_ny = 15, type = 0, distribution = "multinomial")
|
sample_size |
Sample size |
min_nx |
The minimum value of |X| (Default: 3) |
max_nx |
The maximum value of |X| (Default: 15) |
min_ny |
The minimum value of |Y| (Default: 3) |
max_ny |
The maximum value of |Y| (Default: 15) |
type |
type=0: standard version, type=1: |X|=|Y|, type=2: |Y'|=|Y|, type=3: |X|=|Y'|, type=4: |X|=|Y'|=|Y| (Default: type=0) |
distribution |
The distribution of the cause X. The options are "multinomial","geom","hyper","nbinom","pois". Default: multinomial |
return the synthetic data
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | df=simuXY(sample_size=100,type=0)
length(unique(df[,1]))
length(unique(df[,2]))
length(unique(df[,3]))
df=simuXY(sample_size=100,type=1)
length(unique(df[,1]))
length(unique(df[,3]))
df=simuXY(sample_size=100,type=2)
length(unique(df[,2]))
length(unique(df[,3]))
df=simuXY(sample_size=100,type=3)
length(unique(df[,1]))
length(unique(df[,2]))
df=simuXY(sample_size=100,type=4)
length(unique(df[,1]))
length(unique(df[,2]))
length(unique(df[,3]))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.