Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Code:
    . frames reset
    
    . *
    
    . 
    . * Begin here
    
    . 
    . *
    
    . 
    . 
    . 
    . frame create Integrals byte(pid grp) double auc
    
    . 
    . 
    . 
    . quietly levelsof participantid , local(pids)
    no variables defined
    r(111);
    
    . 
    . 
    . 
    . foreach pid of local pids {
      2. 
    . 
    . 
    .     summarize group if participantid == `pid', meanonly
      3. 
    .     local grp `r(min)'
      4. 
    . 
    . 
    .     quietly integ parasitaemia time if participantid == `pid' // , trapezoid
      5. 
    .     frame post Integrals (`pid') (`grp') (r(integral))
      6. 
    . }
    no variables defined
    r(111);
    
    . 
    . 
    . 
    . frame Integrals: list, noobs
    
    . 
    . 
    . 
    . exit
    no; dataset in memory has changed since last saved
        There are unsaved data in frame Integrals. Save the data or specify option clear to exit anyway.
    r(4);
    
    .
    VoilĂ , thanks for Your continuing help.

    Comment


    • #17
      This is a different error (no variables defined) from what you mentioned earlier (_b not allowed when e(b) is not present).

      Did you make sure that your dataset was loaded before running the code? It should be loaded in the main dataset memory, the so-called default frame, not in the Integrals frame that you create with the code, in case that wasn't clear #12 above.

      Otherwise, the only suggestion that I have is for you to attach your dataset, and I can run the code against it and deliver back a dataset of the integrals for you to run with, along with the do-file and log file for your records.

      Comment


      • #18
        Dear Andrew, dear Joseph,

        Many thanks again for Your help and excuse my silence. Here's finally the solution I came up with (including statistical testing):

        Code:
        ******
        ****** AUC and Student's t-test
        ******
        
        recast float time
        *add dummy value which is half of limit of detection = 10 for P. falciparum
        gen parasitaemia5=parasitaemia+5
        *log 10 transformation of parasitaemia
        gen log_parasitaemia=log10(parasitaemia5)
        *get overview of pharmacokinetic measures
        pksumm participantid time log_parasitaemia, fit(3) trapezoid notimechk graph stat(auc) frequency kdensity
        *generate table of AUC by participant
        sort participantid time
        by participantid , sort: integ log_parasitaemia time, gen(auc) t
        *only keep total AUC at last visit
        keep if time==168
        *discard groups not to be tested
        keep if group>3
        *calculate and graph Student's t-test
        ttest auc, by(group)
        graph box auc, over(group)
        Many thanks again for Your assistance that really furthered my understanding of Stata

        Comment

        Working...
        X