Announcement

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

  • Issue concerning pre-post paired variables

    Dear fellow members,
    -
    I hava a dataset with several pre-post variables, I mean, each pair have the same name, plus the suffix "-pre" or "-pos".

    Since I need to perform almost a hundred "paired" tests" (t and signed rank), I wonder if there is a code to streamline this process.

    In short, something that would recognize identical names (but for the suffix) and perform the tests for each pair of variables.

    Below, I share a fraction of the data.

    Lots of thanks in advance for any help.

    Kind regards

    Marcos
    Attached Files
    Best regards,

    Marcos

  • #2
    You need to reduce the length of some of your variable names (some are already 34 characters in length). I won't deal with this in the solution that I provide below - here I delete variables whose names exceed 28 characters in length. For ranksum, you need to reshape to a long format. Here is how to extract prefixes.

    Code:
    use pilot, clear
    rename IN INN
    drop ladoacometido
    foreach var of varlist *{
        if length("`var'")>28{
            drop `var'
         }
    }
    rename *, lower
    foreach ending in pre pos{
        qui ds *_`ending'
        local `ending'vars `=ustrregexra("`r(varlist)'", "_`ending'", "")'
    }
    
    local all `prevars' `postvars'
    local all: list uniq all
    keep id -ladoacometido *_pre *_pos
    reshape long `all', i(id) j(which) string
    
    foreach var in `all'{
        display "variable = `var'"
        cap noisily ranksum `var', by(which)
    }
    Res.:

    Code:
    . foreach var in `all'{
      2.
    .     display "variable = `var'"
      3.
    .     cap noisily ranksum `var', by(which)
      4.
    . }
    variable = ash_biceps
    
    Two-sample Wilcoxon rank-sum (Mann–Whitney) test
    
           which |      Obs    Rank sum    Expected
    -------------+---------------------------------
            _pos |        5        23.5        27.5
            _pre |        5        31.5        27.5
    -------------+---------------------------------
        Combined |       10          55          55
    
    Unadjusted variance       22.92
    Adjustment for ties       -1.39
                         ----------
    Adjusted variance         21.53
    
    H0: ash_bi~s(which==_pos) = ash_bi~s(which==_pre)
             z = -0.862
    Prob > |z| = 0.3886
    Exact prob = 0.4683
    variable = ash_adutores
    
    Two-sample Wilcoxon rank-sum (Mann–Whitney) test
    
           which |      Obs    Rank sum    Expected
    -------------+---------------------------------
            _pos |        5          26        27.5
            _pre |        5          29        27.5
    -------------+---------------------------------
        Combined |       10          55          55
    
    Unadjusted variance       22.92
    Adjustment for ties       -2.50
                         ----------
    Adjusted variance         20.42
    
    H0: ash_ad~s(which==_pos) = ash_ad~s(which==_pre)
             z = -0.332
    Prob > |z| = 0.7399
    Exact prob = 1.0000
    variable = ash_rotadores
    
    Two-sample Wilcoxon rank-sum (Mann–Whitney) test
    
           which |      Obs    Rank sum    Expected
    -------------+---------------------------------
            _pos |        5          23        27.5
            _pre |        5          32        27.5
    -------------+---------------------------------
        Combined |       10          55          55
    
    Unadjusted variance       22.92
    Adjustment for ties       -3.47
                         ----------
    Adjusted variance         19.44
    
    H0: ash_ro~s(which==_pos) = ash_ro~s(which==_pre)
             z = -1.021
    Prob > |z| = 0.3075
    Exact prob = 0.4444
    variable = ash_flexpunho
    
    Two-sample Wilcoxon rank-sum (Mann–Whitney) test
    
           which |      Obs    Rank sum    Expected
    -------------+---------------------------------
            _pos |        5        25.5        27.5
            _pre |        5        29.5        27.5
    -------------+---------------------------------
        Combined |       10          55          55
    
    Unadjusted variance       22.92
    Adjustment for ties       -3.47
                         ----------
    Adjusted variance         19.44
    
    H0: ash_fl~o(which==_pos) = ash_fl~o(which==_pre)
             z = -0.454
    Prob > |z| = 0.6501
    Exact prob = 0.9206
    variable = cif_b735_1
    
    Two-sample Wilcoxon rank-sum (Mann–Whitney) test
    
           which |      Obs    Rank sum    Expected
    -------------+---------------------------------
            _pos |        5        22.5        27.5
            _pre |        5        32.5        27.5
    -------------+---------------------------------
        Combined |       10          55          55
    
    Unadjusted variance       22.92
    Adjustment for ties       -2.50
                         ----------
    Adjusted variance         20.42
    
    H0: cif_~5_1(which==_pos) = cif_~5_1(which==_pre)
             z = -1.107
    Prob > |z| = 0.2685
    Exact prob = 0.4286
    variable = cif_b760_1
    
    Two-sample Wilcoxon rank-sum (Mann–Whitney) test
    
           which |      Obs    Rank sum    Expected
    -------------+---------------------------------
            _pos |        5          25        27.5
            _pre |        5          30        27.5
    -------------+---------------------------------
        Combined |       10          55          55
    
    Unadjusted variance       22.92
    Adjustment for ties       -1.39
                         ----------
    Adjusted variance         21.53
    
    H0: cif~60_1(which==_pos) = cif~60_1(which==_pre)
             z = -0.539
    Prob > |z| = 0.5900
    Exact prob = 0.8095
    variable = cif_d4452_1
    
    --------------------------------------TRUNCATED----------------------------------------------
    
    variable = fulg_a
    
    Two-sample Wilcoxon rank-sum (Mann–Whitney) test
    
           which |      Obs    Rank sum    Expected
    -------------+---------------------------------
            _pos |        5        29.5        27.5
            _pre |        5        25.5        27.5
    -------------+---------------------------------
        Combined |       10          55          55
    
    Unadjusted variance       22.92
    Adjustment for ties       -0.28
                         ----------
    Adjusted variance         22.64
    
    H0: fulg_a(which==_pos) = fulg_a(which==_pre)
             z =  0.420
    Prob > |z| = 0.6742
    Exact prob = 0.7222
    variable = fulg_b
    
    Two-sample Wilcoxon rank-sum (Mann–Whitney) test
    
           which |      Obs    Rank sum    Expected
    -------------+---------------------------------
            _pos |        5          27        27.5
            _pre |        5          28        27.5
    -------------+---------------------------------
        Combined |       10          55          55
    
    Unadjusted variance       22.92
    Adjustment for ties       -5.00
                         ----------
    Adjusted variance         17.92
    
    H0: fulg_b(which==_pos) = fulg_b(which==_pre)
             z = -0.118
    Prob > |z| = 0.9060
    Exact prob = 1.0000
    variable = fulg_c
    
    Two-sample Wilcoxon rank-sum (Mann–Whitney) test
    
           which |      Obs    Rank sum    Expected
    -------------+---------------------------------
            _pos |        5          27        27.5
            _pre |        5          28        27.5
    -------------+---------------------------------
        Combined |       10          55          55
    
    Unadjusted variance       22.92
    Adjustment for ties       -0.56
                         ----------
    Adjusted variance         22.36
    
    H0: fulg_c(which==_pos) = fulg_c(which==_pre)
             z = -0.106
    Prob > |z| = 0.9158
    Exact prob = 0.9524
    variable = fulg_d
    
    Two-sample Wilcoxon rank-sum (Mann–Whitney) test
    
           which |      Obs    Rank sum    Expected
    -------------+---------------------------------
            _pos |        5          29        27.5
            _pre |        5          26        27.5
    -------------+---------------------------------
        Combined |       10          55          55
    
    Unadjusted variance       22.92
    Adjustment for ties       -3.33
                         ----------
    Adjusted variance         19.58
    
    H0: fulg_d(which==_pos) = fulg_d(which==_pre)
             z =  0.339
    Prob > |z| = 0.7346
    Exact prob = 0.9206
    variable = fulg_h
    
    Two-sample Wilcoxon rank-sum (Mann–Whitney) test
    
           which |      Obs    Rank sum    Expected
    -------------+---------------------------------
            _pos |        5        27.5        27.5
            _pre |        5        27.5        27.5
    -------------+---------------------------------
        Combined |       10          55          55
    
    Unadjusted variance       22.92
    Adjustment for ties       -5.14
                         ----------
    Adjusted variance         17.78
    
    H0: fulg_h(which==_pos) = fulg_h(which==_pre)
             z =  0.000
    Prob > |z| = 1.0000
    Exact prob = 1.0000
    variable = fulg_j1
    
    Two-sample Wilcoxon rank-sum (Mann–Whitney) test
    
           which |      Obs    Rank sum    Expected
    -------------+---------------------------------
            _pos |        5        28.5        27.5
            _pre |        5        26.5        27.5
    -------------+---------------------------------
        Combined |       10          55          55
    
    Unadjusted variance       22.92
    Adjustment for ties       -4.86
                         ----------
    Adjusted variance         18.06
    
    H0: fulg_j1(which==_pos) = fulg_j1(which==_pre)
             z =  0.235
    Prob > |z| = 0.8139
    Exact prob = 0.8413
    variable = fulg_j2
    
    Two-sample Wilcoxon rank-sum (Mann–Whitney) test
    
           which |      Obs    Rank sum    Expected
    -------------+---------------------------------
            _pos |        5        32.5        27.5
            _pre |        5        22.5        27.5
    -------------+---------------------------------
        Combined |       10          55          55
    
    Unadjusted variance       22.92
    Adjustment for ties       -1.39
                         ----------
    Adjusted variance         21.53
    
    H0: fulg_j2(which==_pos) = fulg_j2(which==_pre)
             z =  1.078
    Prob > |z| = 0.2812
    Exact prob = 0.3333
    
    .

    Comment


    • #3
      Andrew Musau Thank you so much for the code and for your effort to provide this great solution!

      My main concern is that I need to perform a paired t test and the signed rank.
      Last edited by Marcos Almeida; 05 Dec 2023, 05:39.
      Best regards,

      Marcos

      Comment


      • #4
        Right. Just a simple modification needed to extract pairs. You then do not need to worry about variable name lengths as no reshape is needed.

        Code:
        use pilot, clear
        rename IN INN
        drop ladoacometido
        rename *, lower
        foreach ending in pre pos{
            qui ds *_`ending'
            local `ending'vars `=ustrregexra("`r(varlist)'", "_`ending'", "")'
        }
        
        local all `prevars' `posvars'
        local all: list uniq all
        local s1: list prevars-posvars
        local s2: list posvars-prevars
        local s `s1' `s2'
        local all: list all -s
        
        foreach var in `all'{
            display "variable = `var'"
            cap noisily ttest `var'_pre= `var'_pos
        }
        Res.:

        Code:
        . foreach var in `all'{
          2. 
        .     display "variable = `var'"
          3. 
        .     cap noisily ttest `var'_pre= `var'_pos
          4. 
        . }
        variable = ash_biceps
        
        Paired t test
        ------------------------------------------------------------------------------
        Variable |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
        ---------+--------------------------------------------------------------------
        ash_bi~e |       5         2.6     .509902    1.140175    1.184285    4.015715
        ash_bi~s |       5           2    .5477226    1.224745    .4792784    3.520722
        ---------+--------------------------------------------------------------------
            diff |       5          .6          .4    .8944272    -.510578    1.710578
        ------------------------------------------------------------------------------
             mean(diff) = mean(ash_biceps_pre - ash_biceps_pos)           t =   1.5000
         H0: mean(diff) = 0                              Degrees of freedom =        4
        
         Ha: mean(diff) < 0           Ha: mean(diff) != 0           Ha: mean(diff) > 0
         Pr(T < t) = 0.8960         Pr(|T| > |t|) = 0.2080          Pr(T > t) = 0.1040
        variable = ash_adutores
        
        Paired t test
        ------------------------------------------------------------------------------
        Variable |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
        ---------+--------------------------------------------------------------------
        ash_ad~e |       5         2.2    .3741657      .83666    1.161149    3.238851
        ash_ad~s |       5           2    .4472136           1     .758336    3.241664
        ---------+--------------------------------------------------------------------
            diff |       5          .2          .2    .4472136    -.355289     .755289
        ------------------------------------------------------------------------------
             mean(diff) = mean(ash_adutores_pre - ash_adutores_pos)       t =   1.0000
         H0: mean(diff) = 0                              Degrees of freedom =        4
        
         Ha: mean(diff) < 0           Ha: mean(diff) != 0           Ha: mean(diff) > 0
         Pr(T < t) = 0.8130         Pr(|T| > |t|) = 0.3739          Pr(T > t) = 0.1870
        variable = ash_rotadores
        
        Paired t test
        ------------------------------------------------------------------------------
        Variable |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
        ---------+--------------------------------------------------------------------
        ash_ro~e |       5         2.6     .244949    .5477226    1.919913    3.280087
        ash_ro~s |       5           2    .4472136           1     .758336    3.241664
        ---------+--------------------------------------------------------------------
            diff |       5          .6          .4    .8944272    -.510578    1.710578
        ------------------------------------------------------------------------------
             mean(diff) = mean(ash_rotadores_~e - ash_rotadores_~s)       t =   1.5000
         H0: mean(diff) = 0                              Degrees of freedom =        4
        
         Ha: mean(diff) < 0           Ha: mean(diff) != 0           Ha: mean(diff) > 0
         Pr(T < t) = 0.8960         Pr(|T| > |t|) = 0.2080          Pr(T > t) = 0.1040
        variable = ash_flexpunho
        
        Paired t test
        ------------------------------------------------------------------------------
        Variable |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
        ---------+--------------------------------------------------------------------
        ash_fl~e |       5         2.4          .6    1.341641    .7341329    4.065867
        ash_fl~s |       5           2    .6324555    1.414214    .2440219    3.755978
        ---------+--------------------------------------------------------------------
            diff |       5          .4          .4    .8944272    -.710578    1.510578
        ------------------------------------------------------------------------------
             mean(diff) = mean(ash_flexpunho_~e - ash_flexpunho_~s)       t =   1.0000
         H0: mean(diff) = 0                              Degrees of freedom =        4
        
         Ha: mean(diff) < 0           Ha: mean(diff) != 0           Ha: mean(diff) > 0
         Pr(T < t) = 0.8130         Pr(|T| > |t|) = 0.3739          Pr(T > t) = 0.1870
        variable = cif_b735_1
        
        Paired t test
        ------------------------------------------------------------------------------
        Variable |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
        ---------+--------------------------------------------------------------------
        ~5_1_pre |       5         2.4          .4    .8944272    1.289422    3.510578
        ~5_1_pos |       5         1.8    .3741657      .83666    .7611494    2.838851
        ---------+--------------------------------------------------------------------
            diff |       5          .6     .244949    .5477226   -.0800874    1.280087
        ------------------------------------------------------------------------------
             mean(diff) = mean(cif_b735_1_pre - cif_b735_1_pos)           t =   2.4495
         H0: mean(diff) = 0                              Degrees of freedom =        4
        
         Ha: mean(diff) < 0           Ha: mean(diff) != 0           Ha: mean(diff) > 0
         Pr(T < t) = 0.9648         Pr(|T| > |t|) = 0.0705          Pr(T > t) = 0.0352
        variable = cif_b760_1
        
        Paired t test
        ------------------------------------------------------------------------------
        Variable |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
        ---------+--------------------------------------------------------------------
        cif_b7.. |       5         2.6     .509902    1.140175    1.184285    4.015715
        cif_b7.. |       5         2.2    .5830952     1.30384    .5810682    3.818932
        ---------+--------------------------------------------------------------------
            diff |       5          .4     .244949    .5477226   -.2800874    1.080087
        ------------------------------------------------------------------------------
             mean(diff) = mean(cif_b760_1_pre - cif_b760_1_pos)           t =   1.6330
         H0: mean(diff) = 0                              Degrees of freedom =        4
        
         Ha: mean(diff) < 0           Ha: mean(diff) != 0           Ha: mean(diff) > 0
         Pr(T < t) = 0.9111         Pr(|T| > |t|) = 0.1778          Pr(T > t) = 0.0889
        variable = cif_d4452_1
        
        Paired t test
        ------------------------------------------------------------------------------
        Variable |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
        ---------+--------------------------------------------------------------------
        ~2_1_pre |       5         2.8    .5830952     1.30384    1.181068    4.418932
        ~2_1_pos |       5         2.6     .678233    1.516575    .7169233    4.483077
        ---------+--------------------------------------------------------------------
            diff |       5          .2          .2    .4472136    -.355289     .755289
        ------------------------------------------------------------------------------
             mean(diff) = mean(cif_d4452_1_pre - cif_d4452_1_pos)         t =   1.0000
         H0: mean(diff) = 0                              Degrees of freedom =        4
        
         Ha: mean(diff) < 0           Ha: mean(diff) != 0           Ha: mean(diff) > 0
         Pr(T < t) = 0.8130         Pr(|T| > |t|) = 0.3739          Pr(T > t) = 0.1870
        variable = cif_d4452_2
        
        Paired t test
        ------------------------------------------------------------------------------
        Variable |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
        ---------+--------------------------------------------------------------------
        ~2_2_pre |       5         2.8    .5830952     1.30384    1.181068    4.418932
        ~2_2_pos |       5         2.6     .678233    1.516575    .7169233    4.483077
        ---------+--------------------------------------------------------------------
            diff |       5          .2          .2    .4472136    -.355289     .755289
        ------------------------------------------------------------------------------
             mean(diff) = mean(cif_d4452_2_pre - cif_d4452_2_pos)         t =   1.0000
         H0: mean(diff) = 0                              Degrees of freedom =        4
        
         Ha: mean(diff) < 0           Ha: mean(diff) != 0           Ha: mean(diff) > 0
         Pr(T < t) = 0.8130         Pr(|T| > |t|) = 0.3739          Pr(T > t) = 0.1870
        variable = cif_d4450_1
        
        Paired t test
        ------------------------------------------------------------------------------
        Variable |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
        ---------+--------------------------------------------------------------------
        cif_d4.. |       5         2.6     .678233    1.516575    .7169233    4.483077
        cif_d4.. |       5           2    .7071068    1.581139    .0367568    3.963243
        ---------+--------------------------------------------------------------------
            diff |       5          .6     .244949    .5477226   -.0800874    1.280087
        ------------------------------------------------------------------------------
             mean(diff) = mean(cif_d4450_1_pre - cif_d4450_1_pos)         t =   2.4495
         H0: mean(diff) = 0                              Degrees of freedom =        4
        
         Ha: mean(diff) < 0           Ha: mean(diff) != 0           Ha: mean(diff) > 0
         Pr(T < t) = 0.9648         Pr(|T| > |t|) = 0.0705          Pr(T > t) = 0.0352
        variable = cif_d4450_2
        
        Paired t test
        ------------------------------------------------------------------------------
        Variable |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
        ---------+--------------------------------------------------------------------
        ~0_2_pre |       5         2.6     .678233    1.516575    .7169233    4.483077
        ~0_2_pos |       5           2    .7071068    1.581139    .0367568    3.963243
        ---------+--------------------------------------------------------------------
            diff |       5          .6     .244949    .5477226   -.0800874    1.280087
        ------------------------------------------------------------------------------
             mean(diff) = mean(cif_d4450_2_pre - cif_d4450_2_pos)         t =   2.4495
         H0: mean(diff) = 0                              Degrees of freedom =        4
        
         Ha: mean(diff) < 0           Ha: mean(diff) != 0           Ha: mean(diff) > 0
         Pr(T < t) = 0.9648         Pr(|T| > |t|) = 0.0705          Pr(T > t) = 0.0352
        variable = cif_d4451_1
        
        Paired t test
        ------------------------------------------------------------------------------
        Variable |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
        ---------+--------------------------------------------------------------------
        cif_d4.. |       5           3    .5477226    1.224745    1.479278    4.520722
        cif_d4.. |       5         2.4     .678233    1.516575    .5169233    4.283077
        ---------+--------------------------------------------------------------------
            diff |       5          .6          .4    .8944272    -.510578    1.710578
        ------------------------------------------------------------------------------
             mean(diff) = mean(cif_d4451_1_pre - cif_d4451_1_pos)         t =   1.5000
         H0: mean(diff) = 0                              Degrees of freedom =        4
        
         Ha: mean(diff) < 0           Ha: mean(diff) != 0           Ha: mean(diff) > 0
         Pr(T < t) = 0.8960         Pr(|T| > |t|) = 0.2080          Pr(T > t) = 0.1040
        variable = cif_d4451_2
        
        Paired t test
        ------------------------------------------------------------------------------
        Variable |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
        ---------+--------------------------------------------------------------------
        ~1_2_pre |       5           3    .5477226    1.224745    1.479278    4.520722
        ~1_2_pos |       5         2.4     .678233    1.516575    .5169233    4.283077
        ---------+--------------------------------------------------------------------
            diff |       5          .6          .4    .8944272    -.510578    1.710578
        ------------------------------------------------------------------------------
             mean(diff) = mean(cif_d4451_2_pre - cif_d4451_2_pos)         t =   1.5000
         H0: mean(diff) = 0                              Degrees of freedom =        4
        
         Ha: mean(diff) < 0           Ha: mean(diff) != 0           Ha: mean(diff) > 0
         Pr(T < t) = 0.8960         Pr(|T| > |t|) = 0.2080          Pr(T > t) = 0.1040
        variable = cif_e1101_1
        
        Paired t test
        ------------------------------------------------------------------------------
        Variable |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
        ---------+--------------------------------------------------------------------
        cif_e1~e |       5         3.4          .4    .8944272    2.289422    4.510578
        cif_e1~s |       5           3    .6324555    1.414214    1.244022    4.755978
        ---------+--------------------------------------------------------------------
            diff |       5          .4     .244949    .5477226   -.2800874    1.080087
        ------------------------------------------------------------------------------
             mean(diff) = mean(cif_e1101_1_pre - cif_e1101_1_pos)         t =   1.6330
         H0: mean(diff) = 0                              Degrees of freedom =        4
        
         Ha: mean(diff) < 0           Ha: mean(diff) != 0           Ha: mean(diff) > 0
         Pr(T < t) = 0.9111         Pr(|T| > |t|) = 0.1778          Pr(T > t) = 0.0889
        variable = cif_e310_1
        
        Paired t test
        ------------------------------------------------------------------------------
        Variable |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
        ---------+--------------------------------------------------------------------
        cif_e3~e |       5           2    .8944272           2    -.483328    4.483328
        cif_e3~s |       5         1.8    .9165151     2.04939    -.744654    4.344654
        ---------+--------------------------------------------------------------------
            diff |       5          .2          .2    .4472136    -.355289     .755289
        ------------------------------------------------------------------------------
             mean(diff) = mean(cif_e310_1_pre - cif_e310_1_pos)           t =   1.0000
         H0: mean(diff) = 0                              Degrees of freedom =        4
        
         Ha: mean(diff) < 0           Ha: mean(diff) != 0           Ha: mean(diff) > 0
         Pr(T < t) = 0.8130         Pr(|T| > |t|) = 0.3739          Pr(T > t) = 0.1870
        variable = cvmob_velo_ida_lateral
        
        Paired t test
        ------------------------------------------------------------------------------
        Variable |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
        ---------+--------------------------------------------------------------------
        cvmob_.. |       4    .7777636    .5408524    1.081705   -.9434701    2.498997
        cvmob_.. |       4    .4322929    .2363735    .4727471   -.3199532    1.184539
        ---------+--------------------------------------------------------------------
            diff |       4    .3454707    .3094388    .6188776   -.6393016    1.330243
        ------------------------------------------------------------------------------
             mean(diff) = mean(cvmob_velo_ida~e - cvmob_velo_ida~s)       t =   1.1164
         H0: mean(diff) = 0                              Degrees of freedom =        3
        
         Ha: mean(diff) < 0           Ha: mean(diff) != 0           Ha: mean(diff) > 0
         Pr(T < t) = 0.8272         Pr(|T| > |t|) = 0.3456          Pr(T > t) = 0.1728
        variable = cvmob_velo_volta_lateral
        
        Paired t test
        ------------------------------------------------------------------------------
        Variable |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
        ---------+--------------------------------------------------------------------
        cvmob_.. |       4    .7388365    .3579694    .7159388   -.4003819    1.878055
        cvmob_.. |       4    .5423261    .2564292    .5128584    -.273746    1.358398
        ---------+--------------------------------------------------------------------
            diff |       4    .1965104    .1048099    .2096198   -.1370415    .5300623
        ------------------------------------------------------------------------------
             mean(diff) = mean(cvmob_velo_vol~e - cvmob_velo_vol~s)       t =   1.8749
         H0: mean(diff) = 0                              Degrees of freedom =        3
        
         Ha: mean(diff) < 0           Ha: mean(diff) != 0           Ha: mean(diff) > 0
         Pr(T < t) = 0.9213         Pr(|T| > |t|) = 0.1575          Pr(T > t) = 0.0787
        variable = cvmob_acel_ida_lateral
        
        Paired t test
        ------------------------------------------------------------------------------
        Variable |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
        ---------+--------------------------------------------------------------------
        cvmob_.. |       4    .0971805    .0411243    .0822487   -.0336955    .2280564
        cvmob_.. |       4    .0831097    .0368557    .0737114   -.0341816     .200401
        ---------+--------------------------------------------------------------------
            diff |       4    .0140707    .0063743    .0127485    -.006215    .0343565
        ------------------------------------------------------------------------------
             mean(diff) = mean(cvmob_acel_ida~e - cvmob_acel_ida~s)       t =   2.2074
         H0: mean(diff) = 0                              Degrees of freedom =        3
        
         Ha: mean(diff) < 0           Ha: mean(diff) != 0           Ha: mean(diff) > 0
         Pr(T < t) = 0.9428         Pr(|T| > |t|) = 0.1144          Pr(T > t) = 0.0572
        variable = cvmob_acel_volta_lateral
        
        Paired t test
        ------------------------------------------------------------------------------
        Variable |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
        ---------+--------------------------------------------------------------------
        cvmob_.. |       4    .1799884    .0702435     .140487   -.0435579    .4035346
        cvmob_.. |       4    .1331333    .0490312    .0980625    -.022906    .2891726
        ---------+--------------------------------------------------------------------
            diff |       4    .0468551    .0224453    .0448907    -.024576    .1182862
        ------------------------------------------------------------------------------
             mean(diff) = mean(cvmob_acel_vol~e - cvmob_acel_vol~s)       t =   2.0875
         H0: mean(diff) = 0                              Degrees of freedom =        3
        
         Ha: mean(diff) < 0           Ha: mean(diff) != 0           Ha: mean(diff) > 0
         Pr(T < t) = 0.9360         Pr(|T| > |t|) = 0.1281          Pr(T > t) = 0.0640
        Last edited by Andrew Musau; 05 Dec 2023, 06:36.

        Comment


        • #5
          Andrew Musau Wow, Really awesome, thank you so much, I'm feeling so much grateful for your great work!

          Lots of thanks.
          Best regards,

          Marcos

          Comment

          Working...
          X