Modafinil community survey

2015 survey of online modafinil users asking about dosages, consumption patterns, ratings, purchases, and demographics
biology, psychology, nootropics, statistics, R, survey
2015-06-012018-06-21 in progress certainty: highly likely importance: 9


2015

Background

In June 2015, I be­gan de­vel­op­ing a modafinil sur­vey; I wanted a bet­ter pic­ture of modafinil users, par­tic­u­larly the in­ter­cept rates and po­ten­tial ge­netic mod­er­a­tor. After some months of oc­ca­sional work and some feed­back from Modafinil­Cat, who had also vol­un­teered to offer a prize when I men­tioned the draft, I fin­ished the 2015 sur­vey on 2015-09-26, leav­ing it open for a mon­th, and post­ing no­ti­fi­ca­tions to a va­ri­ety of places on­line:

The com­mu­nity re­sponse was en­thu­si­as­tic. Peo­ple pointed out in com­ments & the feed­back part of the form is­sues with the sur­vey which will hope­fully be fixed for next year.

Data

I closed the sur­vey ~1:10PM 2015-10-27, hav­ing got­ten 3835 re­sponses which pass QA. (My hope was to get <=1k re­spons­es, which makes this a big suc­cess.)

The data:

Results

Demographics

  1. Gen­der: 89% male, 11% fe­male (in­ter­est­ing­ly, this is al­most iden­ti­cal to the )

  2. Age: mean of 29 and most are in their 20s-ear­ly-30s, but there’s a wide spread of ages past that, with re­spon­dents claim­ing to be as young as 16 to as old as 81. His­togram: http­s://i.imgur.­com/WunT­GiP.png

  3. Coun­try: un­sur­pris­ingly given the web­sites in­volved, sur­vey re­sults are dom­i­nated by re­spon­dents from (in de­scend­ing or­der), the USA (56%), Aus­tralia (18%), UK (11%), Canada (2%), France (1%), Ger­many (1%), Nether­lands (0.8%), Sin­ga­pore (0.7%), Poland (0.36%), Ire­land (0.33%), and Thai­land (0.33%), with a scat­ter­ing of other coun­tries.

  4. Eth­nic­i­ty/race: pre­dictable from the coun­try data - 77% non-His­panic whites, 9% East Asians, the rest fairly evenly dis­trib­uted across South Asians, blacks, His­pan­ics, Mid­dle East­ern, etc.

  5. In­come: the me­dian re­sponse is quite high, around $45k (so some­what above the an­nual US per-capita me­dian in­come), mean=$65k, but also with plenty of low earn­ers, a fair num­ber of peo­ple re­port­ing zero in­come (pre­sum­ably stu­dents or un­em­ployed), and a few very high earn­ers claim­ing as high as $6m; this sort of skew­ing is com­mon in in­come data, though, and the his­togram of the log of re­ported in­come looks right, so the high in­comes may be ac­cu­rate.

  6. Job: the in­come data is strik­ing given that ‘stu­dent’ is the most com­monly re­ported oc­cu­pa­tion, and re­ported mean in­comes do differ by work sta­tus:

    • Stu­dent: 34.31% ($18,767)
    • For-profit work (pri­vate sec­tor): 31.01% ($83,969)
    • Self­-em­ployed: 15.75% ($91,616)
    • Aca­d­e­mic: 4.08% ($54,995)
    • Gov­ern­ment work: 3.01% ($67,813)
    • Non-profit work: 1.86% ($77,422)
    • Un­em­ployed: 1.96% ($19,212)

    So we see there is some truth to the stereo­type that modafinil is used mostly by stu­dents and pro­fes­sion­als - be­tween those two cat­e­gories, that’s eas­ily 80%. There is much less acad­e­mia than ex­pect­ed, though.

  7. Ed­u­ca­tion: I’ll break this down by lev­el:

    • High school: 18.23%
    • As­so­ci­ate’s de­gree: 10.94%
    • Bach­e­lor’s: 48.46%
    • Mas­ters: 13.66%
    • Pro­fes­sional de­gree (MD/JD/etc): 4.53%
    • PhD: 4.18%

    So 82% of re­spon­dents have some sort of higher ed­u­ca­tion.

Usage

Experiences
  • Modafinil is the most pop­u­lar of the 3 main -afinils, at 78%; fol­lowed by ar­modafinil at 19% and adrafinil at a bare 4%.

    In­ter­est­ing­ly, many modafinil users have given ar­modafinil a try as well; about half of those who pre­fer modafinil have used ar­modafinil at least once. I won­der if this is re­lated to the longer halflife of the ar­modafinil iso­mer? (~2% have ever tried hy­drafinil.)

  • Generic vs name-brand is some­times in­voked to ex­plain is­sues like rashes or no effect. Most re­spon­dents (65%) can­not com­pare them, but of the ones who can, there is no con­sen­sus about what the differ­ence is - 60% say they seem about the same, with the re­main­der evenly split be­tween bet­ter/­worse. How.­effec­tive.­do.y­ou.find­.­modafinil.

[6] “How.pri­mar­i­ly.­do.y­ou.use..afinils.” [7] “You.use.­modafinil.every.N.­days.” [8] “How.­many.­month­s.have.y­ou.been.us­ing.­modafinil.” [9] “What.­dosage.­do.y­ou.usu­al­ly.use.per.24.hours.”

[12] “Have.y­ou.­found.it.help­ful.­for.any.of.the.­fol­low­ing.is­sues.” [67] “Do.y­ou.stil­l.use..afinil.” [68] “Why.­did.y­ou.stop..afinil.us­age.” [69] “How.­many.­days.a­go.­did.y­ou.last.use.­modafinil.” [81] “Help­ful.is­sues.N” [72] “How.­would.y­ou.rate.y­our.­main..afinil.­for.those.us­es…­Day..en­er­gy..­mo­ti­va­tion.” [73] “How.­would.y­ou.rate.y­our.­main..afinil.­for.those.us­es…Night..skip.sleep.” [74] “How.­would.y­ou.rate.y­our.­main..afinil.­for.those.us­es…Cog­ni­tive.en­hance­ment.” [75] “How.­would.y­ou.rate.y­our.­main..afinil.­for.those.us­es…­Day..re­duce.sleepi­ness.” [77] “How.­would.y­ou.rate.y­our.­main..afinil.­for.those.us­es…Med­ical.” [79] “Which.­type­.of..afinil.­do.y­ou.use.the.­most.” [80] “Why.­did.y­ou.stop..afinil.us­age..1”

Genetics

Bodenmann et al 2009 nonreplication

“Phar­ma­co­ge­net­ics of modafinil after sleep loss: cat­e­chol-O-methyl­trans­ferase geno­type mod­u­lates wak­ing func­tions but not re­cov­ery sleep”, Bo­den­mann et al 2009 found that of n=22 sub­jects, the ones with Val/­Val (GG) on the SNP Rs4680 had con­sid­er­ably bet­ter sub­jec­tive ex­pe­ri­ences dur­ing sleep de­pri­va­tion, while effi­cacy in Met/Met (AA) across var­i­ous mea­sures was much smaller and some­times nonex­is­tent. This is most in­trigu­ing as the effect sizes are large enough that Rs4680 could ex­plain why peo­ple can differ so much in what they think the effect of modafinil on them­selves is, and could po­ten­tially be use­ful in guid­ing de­ci­sions to try out modafinil given that SNP data like offered by 23andMe can be pur­chased for $100-$200 (ie the size of many sin­gle or­ders or co­pays for modafinil). The prob­lem is that this is a can­di­date-gene ex­per­i­ment, whose re­sults can reach sta­tis­ti­cal-sig­nifi­cance only be­cause they study a sin­gle SNP rather than all avail­able SNPs (which would be a GWAS); can­di­date-gene stud­ies have a fairly no­to­ri­ous rep­u­ta­tion for re­sults not repli­cat­ing and fol­lowup GWAS stud­ies show­ing that dozens or hun­dreds of can­di­date-gene re­sults were bo­gus, and there have been no fol­lowups or repli­ca­tions of Bo­den­mann et al 2009. Since 23andMe has over a mil­lion cus­tomers as of 2015, and many of the mea­sures in Bo­den­mann et al 2009 were sub­jec­tive, it should be pos­si­ble to test the claim us­ing a sur­vey ask­ing peo­ple for both Rs4680 sta­tus and their sub­jec­tive ap­praisal of modafinil effi­ca­cy; if the effect is real and any­where as strong as in­di­cat­ed, it should be ab­solutely clear with a few hun­dred sur­vey re­sults.

216 re­spon­dents in­cluded their Rs4680 sta­tus; the per­cent­age were 26% AA / 42% AG / 32% GG, giv­ing an al­most ex­actly bal­anced num­ber of AAs vs GGs, just as in the Bo­den­mann et al 2009 Eu­ro­pean sam­ple. dbSNP re­ports that of a gen­eral pop­u­la­tion of 1507 sam­ples, the cor­re­spond­ing per­cent­ages were 12%/44%/43%

In re­gress­ing Rs4680 sta­tus on a sum of the 3 re­sponses re­lat­ing to sub­jec­tive ex­pe­ri­ence of modafinil (the 1-5 ‘how effec­tive do you find modafinil’, the bi­nary ‘would you say modafinil has changed your life’, and the num­ber of is­sues re­spon­dent in­di­cated that modafinil helped with), the re­sult is not sta­tis­ti­cal­ly-sig­nifi­cant and is in the op­po­site di­rec­tion. (This is true whether Rs4680 is re­gressed as a lin­ear or cat­e­gor­i­cal pre­dic­tor, and whether the 3 re­sponses are summed or used as sep­a­rate de­pen­dent vari­ables.)

One might think that sam­ple se­lec­tion ac­counts for the lack of effect, as peo­ple for whom modafinil does not work will be much less likely to par­tic­i­pate in the sur­vey; this se­lec­tion effect pre­dicts that there would be a large ex­cess of GGs (for whom modafinil works well) and a cor­re­spond­ing lack of AAs (most of whom it does not work and will not bother to par­tic­i­pate, leav­ing only the luck­ier AAs who think modafinil works for other rea­son­s), large enough to make the effects dis­ap­pear, but in com­par­ing to the pop­u­la­tion fre­quen­cies we see not just in­suffi­cient im­bal­ance to ex­plain the lack of effect, but quite the op­po­site - there’s an ex­cess of AAs and a cor­re­spond­ing re­duc­tion in GGs. (The ex­cess of AAs com­pared to the dbSNP pop­u­la­tion fre­quen­cies may be due to racial differ­ences, since re­spon­dents are mostly Cau­casian or East Asian.)

Placebo SNPs

I also asked about COMT Rs4570625 & COMT Rs4633, as they have been iden­ti­fied in a few in­ter­est­ing can­di­date-gene stud­ies as pos­si­bly caus­ing larger or smaller placebo effects; be­ing able to ad­just sur­vey re­sponses for placebo effects would be use­ful, and by ex­plain­ing vari­a­tion in re­sponses might al­low other re­la­tion­ships to emerge. Un­for­tu­nate­ly, re­gress­ing those two along with Rs4680 shows like­wise non-s­ta­tis­ti­cal­ly-sig­nifi­cant re­sults.

Purchasing behavior

[17] “How.­many.­times.have.y­ou.pur­chased.­modafinil.” [19] “How.­many.u­nit­s…­dos­es.is.y­our.usu­al.or­der…0.10.tablets.” [20] “How.­many.u­nit­s…­dos­es.is.y­our.usu­al.or­der…11.50.” [21] “How.­many.u­nit­s…­dos­es.is.y­our.usu­al.or­der…51.100.” [22] “How.­many.u­nit­s…­dos­es.is.y­our.usu­al.or­der…101.150.” [23] “How.­many.u­nit­s…­dos­es.is.y­our.usu­al.or­der…151.200.” [24] “How.­many.u­nit­s…­dos­es.is.y­our.usu­al.or­der…200.400.” [25] “How.­many.u­nit­s…­dos­es.is.y­our.usu­al.or­der…400..” [26] “How.­much.­does.y­our.usu­al.or­der.­cost.” [27] “How.­much.­do.y­ou.spend.an­nu­al­ly.on..afinils.” [28] “Where.­do.y­ou.usu­al­ly.buy.” [70] “If.­clear­net..which.of.the.­fol­low­ing.have.y­ou.ever.used.”

Risks
Side-effects, tolerance
  • Tol­er­ance: on a Lik­ert go­ing from ‘as effec­tive as first time’ to ‘Be­came com­pletely in­effec­tive’:

    1. 22.61%
    2. 31.18%
    3. 33.82%
    4. 11.08%
    5. 1.31%

    So it seems most users (2-4=76%) would en­dorse some small to sub­stan­tial amount of tol­er­ance de­vel­op­ing, but very few (many fewer than claim to no­tice no tol­er­ance at all) would say the tol­er­ance is to­tal. (On the other hand, per­haps the tol­er­ant drop modafinil us­age and aren’t an­swer­ing the sur­vey.)

  • For those ex­pe­ri­enc­ing tol­er­ance, it tends to set in fast, within weeks: the me­dian is 2 weeks. (Con­sis­tent with placebo effec­t.)

  • Where there is tol­er­ance, one must worry there may also be de­pen­dency or ad­dic­tion; I asked two ques­tions aimed at this, a Lik­ert 1-5 (5=bad) and a yes/no about if they could quit modafinil use im­me­di­ate­ly. For the for­mer, 15% an­swered 4/5, above av­er­age, with 3% in­di­cat­ing 5 and de­pen­den­cy; in the yes/no, 6% chose ‘no’, they could not quit.

  • A list of side-effects was pro­vid­ed. A graph of side-effects re­ported at least 3 times: https://i.imgur.com/iSJUUM9.png

    1. headaches: 1062
    2. smelly urine: 1053
    3. in­som­ni­a/d­iffi­culty falling asleep: 973
    4. anx­i­ety/hy­per­ven­ti­la­tion/­fast heart rate: 637
    5. weight loss: 342
    6. rash or itch­es: 157
    7. ab­dom­i­nal pain: 156
    8. fever or cold or sore throat: 99
    9. sores or blis­ters: 52
    10. swelling face/lip­s/­tongue/throat: 36
    11. dry mouth: 15
    12. nau­sea: 12
    13. di­ar­rhea: 10
    14. loss of ap­petite: 8
    15. ir­ri­tabil­i­ty: 5
    16. de­hy­dra­tion: 4
    17. high blood pres­sure: 4
    18. de­pres­sion: 3
    19. thirst: 3

    I sus­pect the high fre­quency of headaches may be due to peo­ple not get­ting enough food & drink or not try­ing out smaller dos­es. Be­low a fre­quency of 3, there are a lot of free-re­sponse & idio­syn­cratic re­sponses (eg “Mas­sive black eyes from REM de­pri­va­tion” or “I most times poop within an hour of tak­ing it”), which you can read through in the side-effects CSV; no one re­ports (SJS), though.

Origins

[41] “How.­did.y­ou.­hear.of.and.be­come.in­ter­est­ed.in­.­modafinil.” [71] “At.what.age.­did.y­ou.­first.use.any..afinil.”

2016


  • 2016 draft: https://docs.google.com/forms/d/1KVXumV8T1iyNYnYTKZr_aRjhrZSSfxSIJVuoRAUIluM/edit / live https://docs.google.com/forms/d/1KVXumV8T1iyNYnYTKZr_aRjhrZSSfxSIJVuoRAUIluM/viewform

Improvements

  • in­crease from 1 month to 2 months
  • ‘A “rea­son for stop­ping modafinil” if ap­plic­a­ble ques­tion could yield some in­ter­est­ing in­sight.’ <– don’t I have that on the stopped-page?
  • ‘“If you ex­pe­ri­enced tol­er­ance, how many weeks did it take to de­vel­op?” should be days’ <– is ‘1 week’ com­mon enough to switch to days?
  • ‘Might be worth adding emo­tional in­sta­bil­ity or mood­i­ness as an op­tion un­der side-effects.’ <– and ag­gres­sive­ness, im­pa­tience, and ir­ri­tabil­ity
  • clar­ify dosage and fre­quency for each -afinil
  • re­move free-re­sponse en­try on Gen­der be­cause of abuse like ‘meat pop­si­cle’
  • add a pos­i­tiv­ity con­straint on this one to next sur­vey: “How.­much.­does.y­our.usu­al.or­der.­cost.”
  • add a <120 con­straint on At.what.age.­did.y­ou.­first.use.any..afinil. and Cur­ren­t.age; re­duce lower bound to ~10 due to some­one claim­ing they started at 14
  • add a <600 con­straint on Body.weight; loosen lower con­straint to al­low >60kg
  • add a <24h con­straint on Sleep­.­du­ra­tion..on.an.av­er­age.night..how.­many.hours.­do.y­ou.sleep.
  • add a <1000 con­straint on If.y­ou.­ex­pe­ri­enced.­tol­er­ance..how.­many.week­s.­did.it.­take.­to.de­vel­op. (modafinil has not been ap­proved in the USA longer than that)
  • add a >=0 con­straint on How.­many.­times.have.y­our.or­der­s.not.ar­rived.­for.any.rea­son.
  • How.­did.y­ou.­hear.of.and.be­come.in­ter­est­ed.in­.­modafinil.: add Gw­ern.net, Dave As­prey/Bul­let­proof, un­quote Lim­it­less, drugs­fo­rum,blue­light, Slat­eStar­Codex, Tim Fer­riss, Doc­tor, Less­Wrong, Hacker News, Joe Ro­gan, IRC, Quo­ra, NeoGAF, boldand­de­ter­mined.­com
  • re­move com­mas from side-effects en­try “Swelling of your face, lips, tongue, or throat”
  • add clar­i­fy­ing help text to at­ten­tion test ques­tion
  • Coun­try: add Nether­lands, Sin­ga­pore, Ire­land, Thai­land, In­dia, Nor­way, Spain, Bel­gium, Hun­gary, Swe­den, Malaysia, Mex­i­co, Switzer­land, Den­mark, New Zealand, Philip­pines, Viet­nam, Chi­na, Columbia, Czech Re­pub­lic, Italy, Ro­ma­nia, South Ko­rea, Ar­genti­na, Aus­tria, Brazil, Croa­t­ia, Es­to­nia, Hong Kong, Slo­va­kia, South Africa

Analy­sis:

de­mo­graph­ics: stu­dents vs pro­fes­sion­als? what kind of -afinil gets higher rat­ings? does the orig­i­nal modafinil SNP repli­cate? if we take the nootropic grid’s scores, the placebo SNP data, and es­ti­mate a ‘placebo fac­tor’, does this pre­dict ei­ther tol­er­ance or higher modafinil rat­ings? does tol­er­ance fit with close to­gether use of modafinil to skip sleep? half-lives etc what frac­tion of re­spon­dents re­port le­gal en­tan­gle­ments? rw <- func­tion(x,a,b) { for(i in 1:length­(a)) { x <- re­place(x, x==a[i], b[i]); }; re­turn(x) }

moda <- read.csv("https://www.gwern.net/docs/modafinil/survey/2015-10-27-modafinilsurvey.csv")
## duplicates found reading the feedback:
modaC <- moda[-c(110, 293, 396, 459, 776, 1018, 1510, 2429, 3883),]
## delete rows exactly duplicated aside from the first Timestamp column:
modaC <- modaC[!duplicated(modaC[,-1]),]
## clean the data using the trap questions and nonsense values like negative numbers of non-deliveries:
modaC <- modaC[moda$Test.Question.To.See.If.You.re.Paying.Attention!="No",]
modaC <- modaC[!grepl("beta-t-afinil", as.character(modaC$Which.of.these.have.you.ever.used.)),]
modaC <- modaC[modaC$Current.age.<120,]
modaC <- modaC[modaC$How.many.times.have.your.orders.not.arrived.for.any.reason.>=0,]
## total deleted:
nrow(moda) - nrow(modaC)
# [1] 124
modaC[modaC$Country=="The Netherlands" & !is.na(modaC$Country),]$Country <- "Netherlands"
## recode:
modaC[modaC==""] <- NA; modaC[modaC==" "] <- NA; modaC[modaC=="Not Available"] <- NA; modaC[modaC=="N/A"] <- NA

## useful summary variable:
modaC$Helpful.issues.N <- sapply(modaC$Have.you.found.it.helpful.for.any.of.the.following.issues., function(r) { if(!is.na(r)) { count <- 1; return(count + length(gregexpr(",", r)[[1]])); } else { return(0); }})
library(FSA)
Summarize(modaC$Gender)
#                              freq  perc
# 17                              0  0.00
# agender                         1  0.03
# Androgyne                       1  0.03
# Female                        345 11.19
# genderqueer                     1  0.03
# Homongulous                     0  0.00
# lol                             0  0.00
# Male                         2729 88.55
# Meat popsicle                   1  0.03
# Neutrois                        0  0.00
# Non-Binary                      1  0.03
# nonconforming                   1  0.03
# self-identified male penguin    1  0.03
# Transgender MTF                 1  0.03
# Total                        3082 99.98

## parsing the side-effects data to get an idea of problems
library(qdapTools)
sideeffects <- mtabulate(lapply(strsplit(sub("Swelling of your face, lips, tongue, or throat", "Swelling face/lips/tongue/throat", as.character(modaC$Have.you.experienced.any.significant.side.effects.)), ","), function(s) { tolower(sub(" $", "", sub("^ ", "", s))); }))
## convert everything to booleans
for (i in 1:ncol(sideeffects)) { sideeffects[,i] <- as.logical(sideeffects[,i]); }
## keep only side-effects with >2 entries, which filters out most of the custom ones
keep <- c()
for (i in 1:ncol(sideeffects)) { if (sum(sideeffects[,i], na.rm=TRUE) > 2) { keep <- c(keep, i); } }
sideeffectsSubset <- sideeffects[,keep]

longeffects <- stack(sideeffectsSubset)
agside <- aggregate(values ~ ind, sum, data=longeffects)
mp <- barplot(agside$values); text(mp,par("usr")[3],labels=agside$ind,srt=20,offset=1,adj=1,xpd=TRUE)
agside[order(agside$values, decreasing=TRUE),]
#                                         ind values
# 8                                 headaches   1062
# 17                             smelly urine   1053
# 10       insomnia/difficulty falling asleep    973
# 2  anxiety/hyperventilation/fast heart rate    637
# 21                              weight loss    342
# 16                           rash or itches    157
# 1                            abdominal pain    156
# 7              fever or cold or sore throat     99
# 18                        sores or blisters     52
# 19         swelling face/lips/tongue/throat     36
# 15                                     none     17
# 6                                 dry mouth     15
# 13                                   nausea     12
# 5                                  diarrhea     10
# 12                         loss of appetite      8
# 11                             irritability      5
# 3                               dehydration      4
# 9                       high blood pressure      4
# 4                                depression      3
# 14                                       no      3
# 20                                   thirst      3


# Placebo effect factor analysis:
#
# "How.effective.do.you.find.modafinil."  1-5
# "Would.you.say.that.Modafinil.has.changed.your.life." yes/no logical
# "You.use.modafinil.every.N.days."
# "How.many.months.have.you.been.using.modafinil."
# "What.dosage.do.you.usually.use.per.24.hours."
# "Some.users.report..tolerance..or.effects..wearing.off...how.much.have.you.experienced.this." 1-5
# "How.much.do.you.depend.on.modafinil.for.normal.alertness...functioning."
# Helpful.issues.N
# "Would.you.be.able.to.quit.cold.turkey.tomorrow." yes/no
# "How.many.times.have.you.purchased.modafinil."
# "How.much.does.your.usual.order.cost."
# "How.much.do.you.spend.annually.on..afinils."
# "How.would.you.rate.the.effectiveness.of.other.nootropics.you.have.tried...Aniracetam."
# "How.would.you.rate.the.effectiveness.of.other.nootropics.you.have.tried...Adderall."
# "How.would.you.rate.the.effectiveness.of.other.nootropics.you.have.tried...Bacopa."
# "How.would.you.rate.the.effectiveness.of.other.nootropics.you.have.tried...Caffeine."
# "How.would.you.rate.the.effectiveness.of.other.nootropics.you.have.tried...Coluracetam."
# "How.would.you.rate.the.effectiveness.of.other.nootropics.you.have.tried...Creatine."
# "How.would.you.rate.the.effectiveness.of.other.nootropics.you.have.tried...Gingko."
# "How.would.you.rate.the.effectiveness.of.other.nootropics.you.have.tried...Ginseng."
# "How.would.you.rate.the.effectiveness.of.other.nootropics.you.have.tried...Melatonin."
# "How.would.you.rate.the.effectiveness.of.other.nootropics.you.have.tried...MCT.Oil."
# "How.would.you.rate.the.effectiveness.of.other.nootropics.you.have.tried...Nicotine..gum..patch..lozenge..vaping.."
# "How.would.you.rate.the.effectiveness.of.other.nootropics.you.have.tried...Noopept."
# "How.would.you.rate.the.effectiveness.of.other.nootropics.you.have.tried...Oxiracetam."
# "How.would.you.rate.the.effectiveness.of.other.nootropics.you.have.tried...Phenylpiracetam."
# "How.would.you.rate.the.effectiveness.of.other.nootropics.you.have.tried...Piracetam."
# "How.would.you.rate.the.effectiveness.of.other.nootropics.you.have.tried...Pramiracetam."
# "How.would.you.rate.the.effectiveness.of.other.nootropics.you.have.tried...Sulbutiamine."
# "How.would.you.rate.the.effectiveness.of.other.nootropics.you.have.tried...Theanine."
# "How.would.you.rate.the.effectiveness.of.other.nootropics.you.have.tried...Vitamin.D."
#
# "SNP.status.of.COMT.RS4680" factor: Levels:  "Met/Met (AA)" "Val/Met (AG)" "Val/Val (GG)"
# "SNP.status.of.COMT.RS4570625" factor: levels: "GG" "GT" "TT"
# "SNP.status.of.COMT.RS4633" factor: levels: "CC" "CT" "TT"

## Rs4680 GG>AG>AA
modaC$SNP.status.of.COMT.RS4680 <- factor(modaC$SNP.status.of.COMT.RS4680, c("Met/Met (AA)", "Val/Met (AG)", "Val/Val (GG)"), ordered=TRUE)
## Rs4570625 GG>GT>TT
modaC$SNP.status.of.COMT.RS4570625 <- factor(modaC$SNP.status.of.COMT.RS4570625, c("TT", "GT", "GG"), ordered=TRUE)
## Rs4633 CC<CT<TT
modaC$SNP.status.of.COMT.RS4633 <- factor(modaC$SNP.status.of.COMT.RS4633, c("CC", "CT", "TT"), ordered=TRUE)


library(psych)
library(GPArotation)
mfa <- subset(modaC, select=c(How.effective.do.you.find.modafinil., Helpful.issues.N, How.would.you.rate.the.effectiveness.of.other.nootropics.you.have.tried...Aniracetam., How.would.you.rate.the.effectiveness.of.other.nootropics.you.have.tried...Adderall., How.would.you.rate.the.effectiveness.of.other.nootropics.you.have.tried...Bacopa., How.would.you.rate.the.effectiveness.of.other.nootropics.you.have.tried...Caffeine., How.would.you.rate.the.effectiveness.of.other.nootropics.you.have.tried...Gingko., How.would.you.rate.the.effectiveness.of.other.nootropics.you.have.tried...Ginseng., How.would.you.rate.the.effectiveness.of.other.nootropics.you.have.tried...Melatonin., How.would.you.rate.the.effectiveness.of.other.nootropics.you.have.tried...Nicotine..gum..patch..lozenge..vaping.., How.would.you.rate.the.effectiveness.of.other.nootropics.you.have.tried...Noopept., How.would.you.rate.the.effectiveness.of.other.nootropics.you.have.tried...Oxiracetam., How.would.you.rate.the.effectiveness.of.other.nootropics.you.have.tried...Phenylpiracetam., How.would.you.rate.the.effectiveness.of.other.nootropics.you.have.tried...Piracetam., How.would.you.rate.the.effectiveness.of.other.nootropics.you.have.tried...Pramiracetam., How.would.you.rate.the.effectiveness.of.other.nootropics.you.have.tried...Theanine., How.would.you.rate.the.effectiveness.of.other.nootropics.you.have.tried...Vitamin.D., SNP.status.of.COMT.RS4680, SNP.status.of.COMT.RS4570625, SNP.status.of.COMT.RS4633))
mfa$Would.you.say.that.Modafinil.has.changed.your.life. <- unlist(sapply(mfa$Would.you.say.that.Modafinil.has.changed.your.life., function(r) { if(!is.na(r)) { if(r=="Yes") { 1; } else { 0; } } else { NA; } } ))
for (colN in 3:17) { mfa[,colN] <- as.integer(substring(as.character(mfa[,colN]), 1, 1)); }
colnames(mfa) <- c("modafinil", "modafinil.issues", "Aniracetam", "Adderall", "Bacopa", "Caffeine", "Gingko", "Ginseng", "Melatonin", "Nicotine", "Noopept", "Oxiracetam", "Phenylpiracetam", "Piracetam", "Pramiracetam", "Theanine", "Vitamin.D", "RS4680", "RS4570625", "RS4633")
mfaI <- mi(mfa)



fa.parallel(mfa)
factorization <- fa(mfa, nfactors=9, missing=TRUE); factorization

modaC$MR1 <- factorization$scores

no loading of the g-factor on the modafinil responses...!

nfactors(mfa[,13:31])
factorization <- fa(mfa[,13:31], nfactors=1, missing=TRUE); factorization

summary(lm(I(How.effective.do.you.find.modafinil. + as.integer(Would.you.say.that.Modafinil.has.changed.your.life.) + Helpful.issues.N) ~ SNP.status.of.COMT.RS4680, data=modaC))
# Residuals:
#        Min         1Q     Median         3Q        Max
# -3.7159091 -1.6142857  0.2840909  1.3272727  5.3857143
#
# Coefficients:
#                                Estimate  Std. Error  t value Pr(>|t|)
# (Intercept)                  7.66764069  0.13420146 57.13530  < 2e-16
# SNP.status.of.COMT.RS4680.L -0.04132442  0.24501722 -0.16866  0.86623
# SNP.status.of.COMT.RS4680.Q -0.05911647  0.21915006 -0.26975  0.78761
#
# Residual standard error: 1.923034 on 210 degrees of freedom
#   (3622 observations deleted due to missingness)
# Multiple R-squared:  0.0005183721,    Adjusted R-squared:  -0.009000501
# F-statistic: 0.0544573 on 2 and 210 DF,  p-value: 0.9470123
summary(lm(I(How.effective.do.you.find.modafinil. + as.integer(Would.you.say.that.Modafinil.has.changed.your.life.) + Helpful.issues.N) ~ SNP.status.of.COMT.RS4680 + SNP.status.of.COMT.RS4570625 + SNP.status.of.COMT.RS4633, data=modaC))
# Residuals:
#        Min         1Q     Median         3Q        Max
# -3.9535936 -1.6172844  0.0464064  1.3827156  5.0464064
#
# Coefficients:
#                                   Estimate  Std. Error  t value Pr(>|t|)
# (Intercept)                     7.72268872  0.19132819 40.36357  < 2e-16
# SNP.status.of.COMT.RS4680.L    -0.12775491  0.42121973 -0.30330  0.76199
# SNP.status.of.COMT.RS4680.Q     0.45040660  0.48705793  0.92475  0.35625
# SNP.status.of.COMT.RS4570625.L -0.02293345  0.37926735 -0.06047  0.95185
# SNP.status.of.COMT.RS4570625.Q  0.28783591  0.28352042  1.01522  0.31126
# SNP.status.of.COMT.RS4633.L    -0.21861748  0.42769291 -0.51116  0.60982
# SNP.status.of.COMT.RS4633.Q    -0.60914914  0.48573612 -1.25407  0.21132
#
# Residual standard error: 1.909355 on 194 degrees of freedom
#   (3634 observations deleted due to missingness)
# Multiple R-squared:  0.01763532,  Adjusted R-squared:  -0.01274709
# F-statistic: 0.5804452 on 6 and 194 DF,  p-value: 0.745673


# tried to verify g-factor against https://slatestarcodex.com/2014/02/16/nootropics-survey-results-and-analysis/ but the missingness is so massive that the results are garbage

library(mi)
mfaI <- mi(mfa)
mfaI1 <- complete(mfaI, 1)

summary(pool(modafinil ~ as.integer(RS4680) + as.integer(RS4570625) + as.integer(RS4633), data=mfaI))

for (colN in 1:17) { mfaI1[,colN] <- as.integer(mfaI1[,colN]); }

---------------------------------------------------------------------------------------------------------------------------------------------------------

## https://www.dropbox.com/s/xyfkvuysogd8tvf/2015-10-07-modafinilsurvey-raw-preliminary.csv
moda <- read.csv("2015-10-07-modafinilsurvey-raw-preliminary.csv")
## clean trap or invalid responses:
modaC <- moda[moda$Test.Question.To.See.If.You.re.Paying.Attention!="No",]
modaC <- modaC[!grepl("beta-t-afinil", as.character(modaC$Which.of.these.have.you.ever.used.)),]
modaC <- modaC[modaC$Current.age.<120,]
modaC <- modaC[modaC$How.many.times.have.your.orders.not.arrived.for.any.reason.>0,]
nrow(modaC)
# [1] 2957
summary(modaC$Highest.or.current.educational.level)
#                                              Associate's degree                      Bachelor's
#                               7                             277                            1159
#                     High school                         Masters                             PhD
#                             451                             340                             105
# Professional degree (MD/JD/etc)                            NA's
#                             114                             504
summary(modaC$Work.Status)
#                                                                                                        For-profit work (private sector)
#                                                                                                                                     792
#                                                                                                                                 Student
#                                                                                                                                     772
#                                                                                                                           Self-employed
#                                                                                                                                     393
#                                                                                                                                Academic
#                                                                                                                                     103
#                                                                                                                         Government work
#                                                                                                                                      77
#                                                                                                                         Non-profit work
#                                                                                                                                      51
#                                                                                                                              Unemployed
#                                                                                                                                      49
#
#                                                                                                                                      28
#                                                                                                                   Independently wealthy
#                                                                                                                                      18
#                                                                                                                               Homemaker
#                                                                                                                                      16
#                                                                                                                                Military
#                                                                                                                                      13
#                                                                                                                                 retired
#                                                                                                                                       4
#                                                                                                                                Disabled
#                                                                                                                                       3
#                                                                                                                                Engineer
#                                                                                                                                       3
#                                                                                                                               full time
#                                                                                                                                       2
#                                                                                                                                  retail
#                                                                                                                                       2
#                                                                                                                                   Sales
#                                                                                                                                       2
#                                                                                                                      Software Developer
#                                                                                                                                       2
#                                                                                                                            Truck driver
#                                                                                                                                       2
#                                                                                                                             Accounting
#                                                                                                                                       1
#                                                                                                                                  Amazon
#                                                                                                                                       1
#                                                                                                                          Apprenticeship
#                                                                                                                                       1
#                                                                                                                                  artist
#                                                                                                                                       1
#                                                                                                                               Bartender
#                                                                                                                                       1
#                                                                                                         Both student and private sector
#                                                                                                                                       1
#                                                                                                                          Business owner
#                                                                                                                                       1
#                                                                                                                       Casual Retail Job
#                                                                                                                                       1
#                                                                                                   CEMS, continuous emissions monitoring
#                                                                                                                                       1
#                                                                                                                                    chef
#                                                                                                                                       1
#                                                                                                                                    Chef
#                                                                                                                                       1
#                                                                                                                          Chemical plant
#                                                                                                                                       1
#                                                                                                                          Communications
#                                                                                                                                       1
#                                                                                                                     Computer Programmer
#                                                                                                                                       1
#                                                                                                                       contracted artist
#                                                                                                                                       1
#                                                                                                                                    cook
#                                                                                                                                       1
#                                                                                                                                    Cook
#                                                                                                                                       1
#                                                                                                                                 Curator
#                                                                                                                                       1
#                                                                                                                                Designer
#                                                                                                                                       1
#                                                                                                                                Director
#                                                                                                                                       1
#                                                                                                                              Disability
#                                                                                                                                       1
#                                                                                                                                disabled
#                                                                                                                                       1
#                                                                                                                     disabled  SLE Lupus
#                                                                                                                                       1
#                                                                                                         Disabled waiting on SSI Hearing
#                                                                                                                                       1
#                                                                                                                             Dissability
#                                                                                                                                       1
#                                                                                                                      Doctoral Candidate
#                                                                                                                                       1
#                                                                                                                               Education
#                                                                                                                                       1
#                                                                                                                             Electrician
#                                                                                                                                       1
#                                                                                                                                Employed
#                                                                                                                                       1
#                                                                                                                Employed: Crane Operator
#                                                                                                                                       1
#                                                                                                                                engineer
#                                                                                                                                       1
#                                                                                                                            Enterpreneur
#                                                                                                                                       1
#                                                                                                                                    FIFO
#                                                                                                                                       1
#                                                                                                             For-profit work and student
#                                                                                                                                       1
#                                                                                                       Free Lance Engineering Contractor
#                                                                                                                                       1
#                                                                                                                      full time employed
#                                                                                                                                       1
#                                                                                                  Full Time Employee / Part Time Student
#                                                                                                                                       1
#                                                                                                                    full time employment
#                                                                                                                                       1
#                                                                                                                      full-time fireman
#                                                                                                                                       1
#                                                                                                           Full-time sales and education
#                                                                                                                                       1
#                                                                                                       Full time student + full time job
#                                                                                                                                       1
#                                                                                          Full-time Student + Part-time Fast Food Worker
#                                                                                                                                       1
#                                                                                           Full time work and full time student workload
#                                                                                                                                       1
#                                                                                                                                Gap Year
#                                                                                                                                       1
#                                                                                                                   Greenhouse management
#                                                                                                                                       1
#                                                                                                                  health and social care
#                                                                                                                                       1
#                                                                                                                                hospital
#                                                                                                                                       1
#                                                                                                                    Information Security
#                                                                                                                                       1
#                                                                                                                               Insurance
#                                                                                                                                       1
# Internship - becoming full time employment 1 week from now after leaving my previous employer of 9 years due to bad working conditions.
#                                                                                                                                       1
#                                                                                                                              IT Manager
#                                                                                                                                       1
#                                                                                                                         IT Professional
#                                                                                                                                       1
#                                                               I work full time in for profit work aswell as doing post grad In medicine
#                                                                                                                                       1
#                                                            I work two jobs. One where I am self-employed and one where I'm an employee.
#                                                                                                                                       1
#                                                                                                                                 Laborer
#                                                                                                                                       1
#                                                                                                                                  lawyer
#                                                                                                                                       1
#                                                                                                                               Line-Cook
#                                                                                                                                       1
#                                                                                                                   Locally owned company
#                                                                                                                                       1
#                                                                                                                           longshoreman
#                                                                                                                                       1
#                                                                                                                                 Manager
#                                                                                                                                       1
#                                                                                        Marketing/Sales/Management of a fitness facility
#                                                                                                                                       1
#                                                                                                                                Medical
#                                                                                                                                       1
#                                                                                                                        Network Engineer
#                                                                                                                                       1
#                                                                                                                                   Nurse
#                                                                                                                                       1
#                                                                                              owner/operator General contracting company
#                                                                                                                                       1
#                                                                                                                               Paramedic
#                                                                                                                                       1
#                                            Part time 3 days per week in public sector, sometimes freelance work on other 2 working days
#                                                                                                                                       1
#                                                                                                                         pharmaceuticals
#                                                                                                                                       1
#                                                                                                                                   pilot
#                                                                                                                                       1
#                                                                                                                       Prefer not to say
#                                                                                                                                       1
#                                                                                                                            professional
#                                                                                                                                       1
#                                                                                                                            Professional
#                                                                                                                                       1
#                                                                                                                  Professional/executive
#                                                                                                                                       1
#                                                                                                                     professional worker
#                                                                                                                                       1
#                                                                                                                              programmer
#                                                                                                                                       1
#                                                                                                 Recently graduated, awaiting employment
#                                                                                                                                       1
#                                                                                                                            Receptionist
#                                                                                                                                       1
#                                                                                                                             Researcher
#                                                                                                                                       1
#                                                                                                                        Resident doctor
#                                                                                                                                       1
#                                                                                                                                 (Other)
#                                                                                                                                      42
#                                                                                                                                    NA's
#                                                                                                                                     504
summary(modaC$Annual.income)
#       Min.    1st Qu.     Median       Mean    3rd Qu.       Max.       NA's
#       0.00   20000.00   45000.00   65187.35   80000.00 6000000.00        817
summary(modaC$Current.age.)
#     Min.  1st Qu.   Median     Mean  3rd Qu.     Max.     NA's
# 16.00000 23.00000 27.00000 29.58174 33.00000 81.00000      504
hist(modaC$Current.age., xlab="Age", main="2015 modafinil survey")

sort(table(toupper(sub("^ ", "", sub(" $", "", as.character(modaC$Country))))), decreasing=TRUE)
#             UNITED STATES                 AUSTRALIA            UNITED KINGDOM
#                      1730                       572                       350
#                    CANADA                    FRANCE                   GERMANY
#                        72                        38                        31
#               NETHERLANDS                 SINGAPORE                    POLAND
#                        25                        23                        11
#                   IRELAND                  THAILAND                     INDIA
#                        10                        10                         9
#                    NORWAY                     SPAIN                   BELGIUM
#                         9                         9                         8
#                   HUNGARY                    SWEDEN                  MALAYSIA
#                         8                         8                         7
#                    MEXICO               SWITZERLAND                   DENMARK
#                         7                         7                         6
#               NEW ZEALAND               PHILIPPINES                   VIETNAM
#                         6                         6                         6
#                     CHINA                  COLOMBIA            CZECH REPUBLIC
#                         5                         4                         4
#                   FINLAND                     ITALY                   ROMANIA
#                         4                         4                         4
#               SOUTH KOREA                 ARGENTINA                   AUSTRIA
#                         4                         3                         3
#                    BRAZIL                   CROATIA                   ESTONIA
#                         3                         3                         3
#                 HONG KONG                    ISRAEL                  SLOVAKIA
#                         3                         3                         3
#              SOUTH AFRICA        DOMINICAN REPUBLIC                 INDONESIA
#                         3                         2                         2
#                     JAPAN                    JORDAN                 LITHUANIA
#                         2                         2                         2
#                  PORTUGAL                    SERBIA                        SG
#                         2                         2                         2
#                   UKRAINE                    AFRICA                  BULGARIA
#                         2                         1                         1
#                     CHILE                    CYPRUS                   ECUADOR
#                         1                         1                         1
#               EL SALVADOR                        EU     EUROPE/RATHER NOT SAY
#                         1                         1                         1
#                   GRENADA                   ICELAND                   JAMAICA
#                         1                         1                         1
#                     KOREA                    KOSOVO                    LATVIA
#                         1                         1                         1
#                     MALTA               MIDDLE EAST                   MOLDOVA
#                         1                         1                         1
#                MOZAMBIQUE                        MY NOT ANSWERING FOR PRIVACY
#                         1                         1                         1
#                  PAKISTAN          PAPUA NEW GUINEA                    RUSSIA
#                         1                         1                         1
#                    RWANDA                SANDINAVIA               SCANDINAVIA
#                         1                         1                         1
#                     SWISS           THE NETHERLANDS       TRINIDAD AND TOBAGO
#                         1                         1                         1
#                    TURKEY                  VIET NAM
#                         1                         1

Summarize(modaC$Highest.or.current.educational.level)
#                                 freq   perc
# Associate's degree               338  10.94
# Bachelor's                      1497  48.46
# High school                      563  18.23
# Masters                          422  13.66
# PhD                              129   4.18
# Professional degree (MD/JD/etc)  140   4.53
# Total                           3089 100.00
ibw <- aggregate(Annual.income ~ Work.Status, mean, data=modaC)
ibw[ibw$Work.Status=="Student",]
#    Work.Status Annual.income
# 134     Student   18767.01647
ibw[ibw$Work.Status=="For-profit work (private sector)",]
#                         Work.Status Annual.income
# 44 For-profit work (private sector)   83969.00852
ibw[ibw$Work.Status=="Self-employed",]
#       Work.Status Annual.income
# 124 Self-employed   91616.59615
ibw[ibw$Work.Status=="Academic",]
#   Work.Status Annual.income
# 1    Academic   54995.84821
ibw[ibw$Work.Status=="Government work",]
#        Work.Status Annual.income
# 59 Government work   67813.33793
ibw[ibw$Work.Status=="Non-profit work",]
#        Work.Status Annual.income
# 91 Non-profit work   77422.90909
ibw[ibw$Work.Status=="Unemployed",]
#     Work.Status Annual.income
# 152  Unemployed   19212.76596

summary(modaC$Race.ethnicity)
#                                      Asian (East Asian) Asian (Indian subcontinent)
#                          14                         217                          78
#                       Black                    Hispanic              Middle Eastern
#                          35                          98                          26
#                       Other        White (non-Hispanic)                        NA's
#                          92                        1893                         504
## note that this is highly biased by sampling from recent modafinil users (and hence recent modafinil sellers given turnover), and by the heavy promotion of this survey on ModafinilCat's mailing list:
library(qdapTools)
clearnetSellers <- mtabulate(lapply(strsplit(as.character(modaC$If.clearnet..which.of.the.following.have.you.ever.used.), ","), function(s) { tolower(sub(" $", "", sub("^ ", "", s))); }))
## convert everything to booleans
for (i in 1:ncol(clearnetSellers)) { clearnetSellers[,i] <- as.logical(clearnetSellers[,i]); }
## keep only side-effects with >=2 entries, which filters out most of the custom ones
keep <- c()
for (i in 1:ncol(clearnetSellers)) { if (sum(clearnetSellers[,i], na.rm=TRUE) >= 2) { keep <- c(keep, i); } }
clearnetSellersSubset <- clearnetSellers[,keep]
longclear <- stack(clearnetSellersSubset)
agclear <- aggregate(values ~ ind, sum, data=longclear)
agclear[order(agclear$values, decreasing=TRUE),]
#                            ind values
# 23                modafinilcat   1692
# 29                       modup    226
# 41                 powder city    108
# 17              medsforbitcoin    102
# 31         mymodafinil.com/net     95
# 7                   ceretropic     79
# 46                       rxrex     77
# 38                 onemedstore     71
# 49          sunmodalert.ru/com     56
# 53           united pharmacies     50
# 11                   edandmore     45
# 33         new star nootropics     45
# 37                     nubrain     29
# 26             modafinil store     27
# 52          thepharmacyexpress     26
# 25 modafinilnow/armodafinilnow     25
# 2                    airsealed     17
# 39              pharmacy geoff     17
# 18                medstore.biz     14
# 45                 rechem labs     14
# 47                   rxshop.md     14
# 1                4nrx pharmacy     12
# 9                  desiredmeds     12
# 4         biogenesis antiaging     11
# 15        good health pharmacy     11
# 43                         qhi     11
# 3                    aurapharm      7
# 22                     modafin      7
# 44                  quality-rx      6
# 5                   bmpharmacy      5
# 6                btcnootropics      5
# 8      cheapestonlinedrugstore      4
# 12               eurodrugstore      4
# 28                   modafresh      4
# 50            super drug saver      4
# 20                modadropship      3
# 21                  modafiendz      3
# 27                  modafizone      3
# 40                   pharmland      3
# 54             worldpharmacare      3
# 10              don't remember      2
# 13           expresspharmacyrx      2
# 14             getsmartnow.net      2
# 16                    liftmode      2
# 19                   modadeals      2
# 24               modafinillabs      2
# 30                 mymodafinil      2
# 32                     newmind      2
# 34            nootropics depot      2
# 35            nootropicsmexico      2
# 36           nootropics mexico      2
# 42            provigilshop.com      2
# 48            somatropinonline      2
# 51                  tabsmarket      2

## 240 may sound improbable, but the 240 orders guy says he uses 1000mg daily, and spends $2800/annually at $240/order over the past 24 years (age 40-64),
## having bought from 'DesiredMeds, EdAndMore, ModUp, ModafinilCat, myModafinil.com/net'. so maybe he really has bought that many times. He leaves an interesting comment:
## > I would prefer to use the ordinary capsule type amphetamines that were available in the 1960's and 1970's that were available in the U.S.A.
summary(modaC$How.many.times.have.you.purchased.modafinil.)
#       Min.    1st Qu.     Median       Mean    3rd Qu.       Max.       NA's
#   1.000000   1.000000   2.000000   4.377049   4.000000 240.000000        517
## not sure I believe 20-nondeliveries guy though:
summary(modaC$How.many.times.have.your.orders.not.arrived.for.any.reason.)
#       Min.    1st Qu.     Median       Mean    3rd Qu.       Max.       NA's
#  0.0000000  0.0000000  0.0000000  0.1280065  0.0000000 20.0000000        504
with(modaC[!is.na(modaC$How.many.times.have.your.orders.not.arrived.for.any.reason.) & !is.na(modaC$How.many.times.have.you.purchased.modafinil.),], sum(How.many.times.have.your.orders.not.arrived.for.any.reason.) / sum(How.many.times.have.you.purchased.modafinil.))
# [1] 0.02640449438
summary(modaC$Do.you.use.any.drugs.recreationally..excluding.modafinil..alcohol...tobacco..)
#        No  Yes NA's
#   26 1263 1164  504
Summarize(modaC$Do.you.have.a.medical.prescription.for.modafinil.)
#       freq  perc
# No    2714  88.2
# Yes    363  11.8
# Total 3077 100.0
Summarize(modaC$Which.type.of..afinil.do.you.use.the.most.)
#             freq   perc
# adrafinil    114   3.69
# armodafinil  579  18.72
# modafinil   2400  77.59
# Total       3093 100.00
Summarize(modaC$Which.of.these.have.you.ever.used.)
#                                                              freq  perc
# adrafinil                                                      63  2.03
# adrafinil, hydrafinil                                           4  0.13
# adrafinil, hydrafinil, beta-t-afinil                            0  0.00
# armodafinil                                                   106  3.42
# armodafinil, adrafinil                                         17  0.55
# armodafinil, adrafinil, hydrafinil                              1  0.03
# armodafinil, adrafinil, hydrafinil, beta-t-afinil               0  0.00
# beta-t-afinil                                                   0  0.00
# hydrafinil                                                      2  0.06
# modafinil                                                    1573 50.74
# modafinil, adrafinil                                          197  6.35
# modafinil, adrafinil, hydrafinil                               12  0.39
# modafinil, armodafinil                                        853 27.52
# modafinil, armodafinil, adrafinil                             230  7.42
# modafinil, armodafinil, adrafinil, hydrafinil                  24  0.77
# modafinil, armodafinil, adrafinil, hydrafinil, beta-t-afinil    0  0.00
# modafinil, armodafinil, beta-t-afinil                           0  0.00
# modafinil, armodafinil, hydrafinil                             11  0.35
# modafinil, beta-t-afinil                                        0  0.00
# modafinil, hydrafinil                                           7  0.23
# Total                                                        3100 99.99
27.52  + 7.42 + 0.77 + 0.35
# [1] 36.06
36.06/0.78
# [1] 46.23076923
Summarize(modaC$In.general..do.you.find.brand.name..afinils.more.effective.than.generics.)
#                freq   perc
# NA/don't know  2015  65.21
# No              197   6.38
# The same/equal  643  20.81
# Yes             235   7.61
# Total          3090 100.01
100-65
# [1] 35
20.81/(100-65.21)
# [1] 0.5981603909
Summarize(as.factor(modaC$If.you.experienced.tolerance..how.many.weeks.did.it.take.to.develop.))
#       freq   perc
# 0      120   6.99
# 0.1      1   0.06
# 0.5      6   0.35
# 0.6      1   0.06
# 0.7      1   0.06
# 1      367  21.39
# 1.5      3   0.17
# 2      367  21.39
# 3      255  14.86
# 4      219  12.76
# 5       35   2.04
# 6       59   3.44
# 7       10   0.58
# 8       81   4.72
# 9        3   0.17
# 10      21   1.22
# 11       1   0.06
# 12      55   3.21
# ...
Summarize(as.factor(modaC$How.much.do.you.depend.on.modafinil.for.normal.alertness...functioning.))
#       freq   perc
# 1      898  29.15
# 2      860  27.91
# 3      847  27.49
# 4      372  12.07
# 5      104   3.38
# Total 3081 100.00
Summarize(as.factor(modaC$Would.you.be.able.to.quit.cold.turkey.tomorrow.))
#       freq   perc
# No     186   6.01
# Yes   2909  93.99
# Total 3095 100.00