Announcement

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

  • Friedman in stata vs in Prism

    when I do Friedman in stata, it gives me different P value than when I did it in Graphpad prism. In Prism, I delete manually the rows with missing values. I have three measures over time for each individual. in stata I just run the command friedman var1 var2 var3. from both the significance, non significance persist but with different numbers (not exact P valuses). Any explanation? or I might be doing something wrong.

  • #2
    I am the original author of the -friedman- command but I never use it (it was written because one particular client at that time, many years ago, wanted it); however, I know nothing about Graphpad prism so I don't know what they are doing; if you post an example of your data, using -dataex- and posting within CODE blocks (as per the FAQ), I may be able to help re: what the -friedman- command is doing

    Comment


    • #3
      Thanks for your response. Glad to speak to the original author
      This is my data after I made it wide (in terms of visits) but still long in terms of group (treated vs placebo). My other question please any way to tell stata to do friedman for treated and for placebo separately? as I tried by or if, none has worked. I did two separate sheet for each manually.
      dataex ipiratioauc1 ipiratioauc2 ipiratioauc3 group

      ----------------------- copy starting from the next line -----------------------
      Code:
      * Example generated by -dataex-. To install: ssc install dataex
      clear
      input double(ipiratioauc1 ipiratioauc2 ipiratioauc3) long group
      .2330269912647059 .2451710845064207 .1450165625092701 1
      .2025895901843955 .1816664950690817 .1446290509307822 1
      .1334045540475425 .1478527417681296                 . 1
      .1803098106073392 .2960839776519851 .2962146655762097 1
      .3840034890859194 .3605358429055334 .3245378121412726 1
                      .                 . .4421104173244128 1
      .2165484537586932        .016996982 .1512413092868024 1
      .1122716819553272 .3808535388134742 .1062763059639889 1
      .1537766172195993 .1352683750778654 .0674639223427435 1
      .4985534368736553 1.107074055662806 .3563916074063879 1
                      . .3850331379183735 .1533277929333614 1
      .4280923938925788 .5371577241209082 .2671287250631313 1
                      .                 . .2769027704682041 1
                      . .7322294843822921 .7239095766804513 1
      .1299902401889971 .1214012216712829 .0741180905422245 1
             .115436838        .079804181         .11126806 1
                      . .8935047708333334 1.502373416555219 1
                      .                 . .1896127803507767 1
       .208616083058608 .1204280313852814 .3031954041192885 1
      .0838132043379123 .1013362406365611 .1454422451914388 1
      .1729400386375942 .1211358880822747 .3009137006408532 1
      .3409979639775547 .4176234471500722  .154126952268106 1
      .2714260464110263 .5744495070087033                 . 1
       .228836347565508 .2106821916942338 .1024385390356601 1
      .4577974003988178 .2571346177876655 .1443217481560892 1
                      . .2050237882553859  .285036862063371 2
      .3579258836673384 .2745258705947867 .1974079820546885 2
      .9780011666666666 .7282311920426063                 . 2
                      . .8841236709956709 1.161059750738733 2
        .18487907766742                 .                 . 2
                      . .1976001691897313 .3161802743853649 2
      .5306283146856178                 . .2830309469397261 2
             .733131149        .031197586                 . 2
      .2666496999933066 .1853639275331153 .5470211903809692 2
                      . .3703660713084189 .8170944556288171 2
      .4933354121239187 .6248593946306135 .1658427598743256 2
                      .                 . .3509823211129148 2
                      .                 . .2476537359325336 2
      .2053817702629536                 .                 . 2
      .4005153054617118 .4232648534798535 .0919818739177489 2
      .1167602736064293 .0230625291997884  .066829338973725 2
      .5416112094414557                 . .2279348745421245 2
      .2751565015609391 .2561298615032311   .19092600464145 2
                      . .1722850359631977 .0622006012421975 2
                      .                 . .1432569161852058 2
      1.672809111560009                 . .2916368874482401 2
      .2462737274985221 .3063995067833407                 . 2
                      . .7384097427869202 .4499512707605788 2
      .5302095212722586 .2365258182362831  .495987531474973 2
      .2253974050038832 .2809892368313454 .5131283830673413 2
      .2566043439235109 .2083182404127154 .1357947677975196 2
      .4021764182183525 .1581732258623275  .460590113328449 2
      .2457732078562724 .3177858205960291 .1159365758749667 2
      .2379704571118768 .3269683664772727 .2513458175391816 2
      .7140170921717173 .7015430181818182 .2208647294001882 2
      .1003674147321429 .3372831506944445 .1346491703296703 2
       .486456713762383 .4511184596492807 .7028756906512605 2
      .3215618464457904 .4857079248062115  .956133200652967 2
      .9077072940211962 .8707027824044614 .2393762771256586 2
       .252582438085562 .2095642651407327 .1606658377329796 2
      .2047018646404274 .1567282271557272 .0618595302903753 2
             .045603448        .013103448  .728554823761329 2
                      .        .346658709 .0635292477300579 2
      .5832751513401039 .2252925709067057 .2353279536886975 2
      .1164260840428785 .3289489641751926 .1299653560516747 2
      3.479824666666667 1.823899575757576                 . 2
                      .                 .                 . 2
      1.702252030375467 .5495861672150992 .2560568488773483 2
      .2168245364222466 .2003923270318129 .1096176134673863 2
                      .        .005717011 .2142233056690517 2
      .3759020778528802                 .                 . 2
                      . .5385350827353729 .2413912873477541 2
      end
      label values group group1
      label def group1 1 "Saline", modify
      label def group1 2 "Treated", modify
      the data has Patient ID as well
      Last edited by Zainab Mahmood; 22 Jun 2023, 10:37.

      Comment


      • #4
        here is the overall result I have:
        Code:
        . friedman ip*
        
        Friedman =  74.7085
        Kendall =    0.6226
        P-value =    0.0007
        and here is an example for one group (the other should be obvious):
        Code:
        . friedman ip* if group==1
        
        Friedman =  30.4575
        Kendall =    0.6345
        P-value =    0.0158

        Comment


        • #5
          Thank you very much. it is different from what I got, unfortunately. Can you explain the code please so I can reproduce what you did. This data is only example even it is the full set for those 3 variables. within the same sheet I have more other variables named ipi01 ipi02 ipi03, ipiratio01 ipiratio02 ipiratio03..etc
          what ip* means?

          Comment


          • #6
            Sorry I did it for group2 , I did it now for group1 it is exactly the same... Thanks a lot much appreciated. I used freidman ipiratioauc1 ipiratioauc2 ipiratioauc3 if group==1 and it worked!

            Comment


            • #7
              you're welcome and good luck

              Comment

              Working...
              X