Announcement

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

  • correlation between independent samples

    Hi to everybody.
    I have a dubt.
    I have two indipendent sample...Is it correct, to see if there is a correlation, to use the command below




    pwcorr [varlist] [if] [in] [weight] [, pwcorr_options]



    Thanks a million to everybody


  • #2
    Tom:
    correlation is between variables.
    What are you searching for, exactly?
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3

      A parameter was measured on two independent samples. To see if there is a relationship between these two groups (children and adults) is it correct to use the command described above? Thanks a lot

      Comment


      • #4
        Is it correct ???

        Comment


        • #5
          Tom:
          if the parameter is continuous, you my want to consider:
          Code:
          . use "C:\Program Files\Stata17\ado\base\a\auto.dta"
          (1978 automobile data)
          
          . correlate price foreign
          (obs=74)
          
                       |    price  foreign
          -------------+------------------
                 price |   1.0000
               foreign |   0.0487   1.0000
          
          
          . regress price i.foreign
          
                Source |       SS           df       MS      Number of obs   =        74
          -------------+----------------------------------   F(1, 72)        =      0.17
                 Model |  1507382.66         1  1507382.66   Prob > F        =    0.6802
              Residual |   633558013        72  8799416.85   R-squared       =    0.0024
          -------------+----------------------------------   Adj R-squared   =   -0.0115
                 Total |   635065396        73  8699525.97   Root MSE        =    2966.4
          
          ------------------------------------------------------------------------------
                 price | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
          -------------+----------------------------------------------------------------
               foreign |
              Foreign  |   312.2587   754.4488     0.41   0.680    -1191.708    1816.225
                 _cons |   6072.423    411.363    14.76   0.000     5252.386     6892.46
          ------------------------------------------------------------------------------
          
          . test 1.foreign
          
           ( 1)  1.foreign = 0
          
                 F(  1,    72) =    0.17
                      Prob > F =    0.6802
          
          
          
          
          
          .
          Kind regards,
          Carlo
          (StataNow 18.5)

          Comment


          • #6

            Dear, thank you very much. You are very kind. I'll explain the problem better. I have two samples (mice). The first sample (children) consists of three types of children (Typical, HR, LR). The second sample (adult) is made up of only one group. Vocalizations (continuous variable) were measured on these groups. To see the type of relationship between these two groups (children, adult), is it correct to use the commands I wrote earlier? IS IT CORRECT to correlate (Children Typical and adult), (Children HR and adult) and (children LR and adult)? or what do you recommend? Many thanks in advance.

            Comment


            • #7

              I don't know Carlo Lazzaro if my explanation was clear...I Hope so... Thanks a million in advance Tommaso

              Comment


              • #8
                What do you think??

                Comment


                • #9
                  Tommaso:
                  thanks for claryfing.
                  -pwcorr- does not allow categorical variables.
                  I would feel more comfortable with -regress-:
                  Code:
                  . use "C:\Program Files\Stata17\ado\base\a\auto.dta"
                  (1978 automobile data)
                  
                  . g vocalization=price
                  
                  . g patients=rep78
                  (5 missing values generated)
                  
                  . label define patients 2 "children_typical" 3 "children_HR" 4 "children_LR" 5 "adults"
                  
                  . label val patients patients
                  
                  . regress vocalization i.patients
                  
                        Source |       SS           df       MS      Number of obs   =        69
                  -------------+----------------------------------   F(4, 64)        =      0.24
                         Model |  8360542.63         4  2090135.66   Prob > F        =    0.9174
                      Residual |   568436416        64     8881819   R-squared       =    0.0145
                  -------------+----------------------------------   Adj R-squared   =   -0.0471
                         Total |   576796959        68  8482308.22   Root MSE        =    2980.2
                  
                  -----------------------------------------------------------------------------------
                       vocalization | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
                  ------------------+----------------------------------------------------------------
                           patients |
                  children_typical  |   1403.125   2356.085     0.60   0.554    -3303.696    6109.946
                       children_HR  |   1864.733   2176.458     0.86   0.395    -2483.242    6212.708
                       children_LR  |       1507   2221.338     0.68   0.500    -2930.633    5944.633
                            adults  |     1348.5   2290.927     0.59   0.558    -3228.153    5925.153
                                    |
                              _cons |     4564.5   2107.347     2.17   0.034     354.5913    8774.409
                  -----------------------------------------------------------------------------------
                  
                  . mat list e(b)
                  
                  e(b)[1,6]
                             1b.         2.         3.         4.         5.          
                       patients   patients   patients   patients   patients      _cons
                  y1          0   1403.125  1864.7333       1507     1348.5     4564.5
                  
                  . test 2.patients=5.patients
                  
                   ( 1)  2.patients - 5.patients = 0
                  
                         F(  1,    64) =    0.00
                              Prob > F =    0.9687
                  Kind regards,
                  Carlo
                  (StataNow 18.5)

                  Comment


                  • #10

                    I probably haven't explained myself. Vocalization was measured on these two groups (group 1 adult; group 2 HR_CHILDREN, LR_CHILDREN, TYPICAL_CHILDREN). IS IT CORRECT to correlate first (Children Typical vocalization and adult vocalization) then (Children HR vocalization and adult vocalization) and at the end (children LR vocalization and adult vocalization) using pwcorr? The variables vocalization is numeric.. Many thanks in advance Carlo Lazzaro

                    Comment


                    • #11
                      Now, it's clearer Carlo Lazzaro
                      thanks a million in advance

                      Why do you say it's categorical???

                      Best Tommaso

                      Comment


                      • #12
                        Tommaso:
                        you have one categorical predictor (i.e., different groups of patients).
                        Kind regards,
                        Carlo
                        (StataNow 18.5)

                        Comment


                        • #13
                          Thanks a lot @CarloLazzaro

                          Comment


                          • #14
                            Dear Carlo Lazzaro thanks a lot...I ve stata 16...Is it the same???
                            How can we interprate the output?
                            Using your example, what can we say about the relationship between these different groups of patients?
                            Thanks a million in advance...

                            Comment


                            • #15
                              Tommaso:
                              my previous -test- example tells you that we cannot reject the null that there's no difference in -vocalization- when -children_typical- and -adults- patients are compared.
                              You can go on comparing the other groups of patients in the very same way.
                              See also -contrast-, -margin- and -marginsplot-.
                              As an unsolicited advice (that you can safely discard), please note that these issues are covered in any decent textbook on (bio)statistics and fully explained in Stata .pdf manual.
                              Kind regards,
                              Carlo
                              (StataNow 18.5)

                              Comment

                              Working...
                              X