Announcement

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

  • ttest

    Hello, I want to test if the average time spent by husbands and wives is significantly different from each other for each of the categories of relative education. I also want to check if the differences are significantly different for each of the categories of relative education for husbands and wives separately. How can I do that and get all the results in a table?


    Code:
     table  relative_edu if multiple_spouse==0, by(sector) c(mean time_spent_h9 mean time_spent_w9 ) 
    
    ---------------------------------------------------------
    (mean) sector and        |
    Relative education of    |
    spouses                  | mean(time_s~9)  mean(time_s~9)
    -------------------------+-------------------------------
    1                        |
       Husband less educated |       714.6746        688.4442
    Husband equally educated |       736.4643        706.9267
       Husband more educated |       725.1115        700.6602
    -------------------------+-------------------------------
    2                        |
       Husband less educated |       690.7646        684.8276
    Husband equally educated |       704.6498        700.7957
       Husband more educated |       708.8071        707.3984
    ---------------------------------------------------------

    An example dataset:


    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float sector byte multiple_spouse float(time_spent_h9 time_spent_w9 relative_edu)
    1 0 750 720 2
    1 0 825 795 2
    1 0 870 870 0
    1 0 675 900 1
    1 0 810 765 2
    1 0 915 945 2
    1 0 885 825 2
    1 0 675 610 0
    1 0 660 780 1
    1 0 720 810 1
    1 0 705 880 2
    1 0 795 870 1
    1 0 645 705 1
    1 0 660 705 1
    1 0 720 690 2
    1 0 630 735 1
    1 0 825 780 0
    1 0 785 845 1
    1 0 705 850 2
    1 0 750 750 2
    1 0 720 690 2
    1 0 720 690 2
    1 0 720 690 2
    1 0 660 630 0
    1 0 720 720 1
    1 0 720 720 2
    1 0 690 735 1
    1 0 690 720 1
    1 0 705 720 2
    1 0 690 630 2
    1 0 660 630 2
    1 0 630 660 2
    1 0 660 750 2
    1 0 690 630 0
    1 0 720 690 2
    1 0 660 630 2
    1 0 660 660 2
    1 0 690 660 2
    1 0 720 675 2
    1 0 750 780 0
    1 0 660 675 2
    1 0 660 630 1
    1 0 780 630 0
    1 0 600 555 1
    1 0 735 675 2
    1 0 690 645 1
    1 0 540 600 2
    1 0 630 585 2
    1 0 510 540 1
    1 0 600 630 2
    end
    label values relative_edu lab_relative_edu
    label def lab_relative_edu 0 "Husband less educated", modify
    label def lab_relative_edu 1 "Husband equally educated", modify
    label def lab_relative_edu 2 "Husband more educated", modify
Working...
X