genDFdata: Simulate dose-response data

Description Usage Arguments Value Examples

View source: R/analysisMM.R

Description

The function simulates normally distributed dose-response data, according to a prespecified dose-response model (or mean vector) and a given standard deviation.

Usage

1
genDFdata(model, argsMod, doses, n, sigma, mu = NULL)

Arguments

model

Character string giving the name of a model function. The first argument of the model function should be the dose variable.

argsMod

A vector with the arguments for the model function.

doses

Dose levels to be used.

n

Group sample sizes.

sigma

Standard deviation.

mu

If model is not specified mu is used to determine the mean vector of the observations.

Value

A data frame with two columns called dose and resp, corresponding to the dose and simulated response values.

Examples

1
2
3
4
# use emax model
genDFdata("emax", c(e0 = 0.2, eMax = 1, ed50 = 0.05), c(0,0.05,0.2,0.6,1), 20, 1)
# use fixed mean vector
genDFdata(mu = 1:5, doses = 0:4, n = c(20, 20, 10, 5, 1), sigma = 0.2)

Example output

Loading required package: mvtnorm
Loading required package: lattice
    dose        resp
1   0.00  0.47457241
2   0.00  0.02776046
3   0.00  1.49646152
4   0.00  0.30048535
5   0.00  0.96115092
6   0.00 -0.38372285
7   0.00  0.22776343
8   0.00 -1.36041589
9   0.00 -1.20900994
10  0.00  0.50762483
11  0.00  0.55111883
12  0.00  0.36963681
13  0.00 -0.47284206
14  0.00 -1.52418925
15  0.00  0.27451180
16  0.00  0.24429077
17  0.00 -3.07528725
18  0.00  0.13620748
19  0.00  0.19765330
20  0.00  0.14289097
21  0.05 -1.36947961
22  0.05  2.39904161
23  0.05  1.33183700
24  0.05  1.49215851
25  0.05  0.70186342
26  0.05  1.15475088
27  0.05  1.13946231
28  0.05  0.87898349
29  0.05  0.38607572
30  0.05  2.34942532
31  0.05  1.15890785
32  0.05 -0.03504883
33  0.05  0.78477245
34  0.05  0.49107861
35  0.05  0.48940947
36  0.05  2.26091103
37  0.05  0.38095049
38  0.05  0.67556108
39  0.05  0.65465922
40  0.05 -0.45411354
41  0.20  2.10713450
42  0.20  0.62501881
43  0.20  0.04966443
44  0.20  1.52516765
45  0.20  0.47228972
46  0.20  1.47895445
47  0.20  2.40325047
48  0.20  1.12474132
49  0.20  2.06185722
50  0.20  0.04235524
51  0.20  1.31153685
52  0.20  0.25789146
53  0.20 -0.39228112
54  0.20  1.68681081
55  0.20 -0.88048171
56  0.20  0.69729435
57  0.20  0.94351743
58  0.20  0.37555142
59  0.20  0.99496613
60  0.20  2.03487911
61  0.60  2.43333716
62  0.60 -0.11526002
63  0.60  0.76279094
64  0.60  2.09909018
65  0.60  0.72131408
66  0.60  1.32036403
67  0.60  1.31117198
68  0.60  2.29287708
69  0.60  0.22317437
70  0.60  0.93701935
71  0.60  0.77502849
72  0.60  0.53732488
73  0.60  1.40466239
74  0.60  1.03580938
75  0.60  2.54218527
76  0.60  0.63516135
77  0.60  0.34187430
78  0.60  1.15460343
79  0.60  3.95818689
80  0.60  1.24589334
81  1.00  1.11812524
82  1.00  0.68842901
83  1.00  2.18391184
84  1.00  1.78472902
85  1.00  1.49741211
86  1.00  1.98774404
87  1.00  3.72097202
88  1.00  0.29595423
89  1.00  2.76422242
90  1.00  2.12609992
91  1.00  0.76363739
92  1.00  1.79413232
93  1.00  0.64584290
94  1.00 -0.21952671
95  1.00  1.16000974
96  1.00  1.11851404
97  1.00  0.96132683
98  1.00  1.70128688
99  1.00  0.58216690
100 1.00  0.98793127
   dose      resp
1     0 1.2123249
2     0 0.9271415
3     0 0.7623747
4     0 1.0074039
5     0 1.1840498
6     0 0.9488049
7     0 1.1599247
8     0 1.0577982
9     0 1.1478287
10    0 0.9504971
11    0 0.9670617
12    0 0.8221016
13    0 1.1585154
14    0 1.1088119
15    0 1.0230351
16    0 0.8410511
17    0 0.9902460
18    0 0.8380420
19    0 1.2102891
20    0 0.9707101
21    1 2.2764905
22    1 2.1138696
23    1 2.0078110
24    1 1.9892858
25    1 2.2397534
26    1 2.0621850
27    1 1.7659190
28    1 1.6173130
29    1 1.8715309
30    1 2.0804628
31    1 2.1646076
32    1 1.9318992
33    1 2.0484550
34    1 1.9861686
35    1 2.0227734
36    1 1.9342092
37    1 2.2292437
38    1 2.2270136
39    1 1.9622235
40    1 2.5415156
41    2 2.7260504
42    2 2.6999084
43    2 2.9019580
44    2 3.0649211
45    2 2.9149313
46    2 3.1608199
47    2 2.9175956
48    2 2.8020886
49    2 2.6523607
50    2 2.7814329
51    3 3.6524853
52    3 3.7138191
53    3 4.0060318
54    3 3.9146720
55    3 4.1458180
56    4 5.0212125

MCPMod documentation built on March 26, 2020, 7:28 p.m.