So I have some smoking data and have been trying to model the decay of methylation signals upon smoking cessation. To do so I have reassigned ~1038 sample as either smokers (1) or non-smokers (2) based on smoking status and time since quitting. Where at smokers are current smokers and former smokers quitting < t years ago and non-smokers are never smokers and former smokers quitting > t years ago. The data looks like this.
status smcess t0 t4 t8 t12 t16 t20 ...
2 7 2 2 1 1 1 1 ...
2 17 2 2 2 2 2 1 ...
2 6 2 2 1 1 1 1 ...
3 NA 2 2 2 2 2 2 ...
1 0 1 1 1 1 1 1 ...
3 NA 2 2 2 2 2 2 ...
I then wish to compare these recoded "smokers" and "non-smokers" at each value of t. The reason I included current and never smokers is to aid in the statistical power in these models. However, obviously these are not split equally and as one increase the other decreases like so.
smokers = 185,229,271,306,336,362,389,418,445,475,498,516,528,536,541,542,543
nonsmoks = 853,809,767,732,702,676,649,620,593,563,540,522,510,502,497,496,495
t = 0,4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64
I wanted to have ~180 smokers and ~180 non-smokers for each comparison. When i just use sample() I get quite a bit of variation.
My question is what is the best way to sample this data, taking into account the variation in time since quitting and differing numbers of smokers, former smokers and never smokers?
I have tried using split() and cut() based on smcess but this does not split into equal groups given the large number of current (185) and never (494) smokers. Any suggestions or thoughts would be greatly appreciated.
A