Announcement

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

  • Differences between groups in repeted measures

    Hi, I'm learning statistics and using Stata to for my project. I have a question regarding the appropriate statistical method to use based on my data set and suggestions on which Stata command I have to study.

    I have a cohort of 200 subjects with diabetes, pre-diabetes or no diabetes (2-1-0) measurement of variables like smoking (0 or 1), blood pressure (continuous) and ejection fraction category (1 - 2- 3) are collected at baseline, after 1 month and after 1 year. Which statistical analysis should I use to test if there is a significant variation of the variables (smoking, blood pressure and ejection fraction) between the groups of diabetes, pre-diabetes or no diabetes at baseline, at 1 month and at 1 year? Which state command should I study?

    Thanks

    Paolo

  • #2
    Are you wanting to know if the means of smoking are different for each diabetes group and in each time period?

    Comment


    • #3
      Yes, and also adjust for other variables if possible. I can consider the percentages descriptive, but I would like to show if the numerical differences are significantly different from a statistical point of view.

      Comment


      • #4
        Hi, Paolo! For your project, you can use a mixed-effects model to analyze the variation of variables (smoking, blood pressure, and ejection fraction) between groups with diabetes, pre-diabetes, or no diabetes at baseline, 1 month, and 1 year. This model will allow you to account for the nested structure of your data (measurements within subjects) and analyze both fixed and random effects.


        Here are the steps you can follow in Stata:
        1. Prepare Your Data:
          • Ensure your data is in long format, where each row represents a measurement at a specific time point for a subject.
          • You should have variables for subject ID, time point (baseline, 1 month, 1 year), and the dependent variables (smoking, blood pressure, ejection fraction).
        1. Use the mixed Command:
          • The mixed command is suitable for this type of analysis. It allows for the inclusion of fixed effects (group effect) and random effects (subject-specific variation).

        Here is an example of how you can structure your data and run the analysis:

        Code:
           
         * Load your dataset webuse example_dataset, clear  * Generate time variable if not already present (0 = baseline, 1 = 1 month, 2 = 1 year) generate time = 0 if time_point == "baseline" replace time = 1 if time_point == "1 month" replace time = 2 if time_point == "1 year"  * Mixed-effects model for blood pressure mixed blood_pressure diabetes_status time diabetes_status#time || subject_id:, variance  * Mixed-effects model for smoking mixed smoking diabetes_status time diabetes_status#time || subject_id:, variance  * Mixed-effects model for ejection fraction mixed ejection_fraction diabetes_status time diabetes_status#time || subject_id:, variance ​​​​​​​
        Explanation of Commands:
        • mixed dependent_variable independent_variables || random_effects, variance
          • dependent_variable: The variable you are analyzing (blood pressure, smoking, ejection fraction).
          • independent_variables: Fixed effects (diabetes_status, time, and their interaction).
          • random_effects: Subject-specific random effects (subject_id).

        Studying Stata Commands:
        • To study the mixed command, you can refer to the Stata documentation:

        By using the mixed-effects model, you can analyze the variation of your variables while accounting for the longitudinal nature of your data. This approach will help you determine if there are significant differences between the groups at different time points.

        Comment

        Working...
        X