Announcement

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

  • Asking for Stata codes for Mediating Effect "again" (thanks for bringing up the overfitting issues)

    Dear Stata experts,

    Thank you so much for your replies on my initial question regarding the questions for the mediating effects.
    I have checked on overfitting issues and found that I don't have this problem. So glad it turned out that way!

    But I am still struggling to get the right commands for testing the mediating effect among variables.
    I am trying to provide more information about my data this time.
    Please help me get the proper codes.


    - Data: Time Use Data, dyadic data

    - Observations: Single-earner households: 1,683 / Dual-earner households: 1,037 (I am conducting a logit regression for each group)

    - Method: Binary logistic regression

    - Dependent variable: fathers who didn't engage in childcare activities (binary; 1= fathers who spent 0 time on childcare, 0 = fathers who spent at least 10 minutes on childcare)

    - Independent variable: level of individual income (ordinal; 1= low income, 2 = middle income, 3 = high income)

    - Mediator variable: average weekly work hours (categorical; 1 = 40 hours and less, 2 = 41-52 hours, 3 = 53-60 hours, 4 = more than 60 hours per week)

    - 8 Control variables

    * father's education level (4 categories)
    * mother's education level (4 categories)
    * father's gender role attitude (4 categories)
    * mother's gender role attitude (4 categories)
    * age of father (continuous)
    * youngest age of children (continuous)
    * total number of children (3 categories)
    * workday (2 categories)



    I am doing a binary logistic regression analysis and want to find if "weekly work hours" mediates the relationship between father's income and their participation in childcare.

    I've tried several codes but faced constant errors, and now I am lost.

    Could you help me fix this?

    Thank you so much for your help.
    Last edited by Eunhye Kang; 19 May 2025, 11:07.

  • #2
    How should we respond to "I've tried several codes but faced constant errors" without exactly knowing what you did and where the errors occured? Did you really read the Stata Forum's FAQ?

    All who post here should have done this. When advising to read especially the FAQ's #12 concerning data example and syntax I don't mean that your reading should be restricted to it. Please read!

    Comment


    • #3
      Hello Eunhye Kang. Some readers may not have seen this earlier thread, which I believe you are referring to here when you mention the possibility of overfitting.
      --
      Bruce Weaver
      Email: [email protected]
      Version: Stata/MP 19.5 (Windows)

      Comment

      Working...
      X