Announcement

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

  • if loops?

    Hello!

    I'm a PhD student and relatively new to Stata. I have medicaid data, and I am assessing for overexposure to certain medications. I need to create variables for expected 90th, 95th, and 97th growth curve weights based on the child's age in months. I could do this with a series of -replace...if- statements, but I'm wondering if there is a less time consuming way to do this. I think an if loop would help me, but I can't figure out how to do this. Can anyone help?

  • #2
    If you've got the 90th, 95th, and 97th growth curve weights in a table, I would just merge that into your individual-level dataset matching on child_age (in months). This assumes the variable child_age is in both datasets.

    Code:
    use individual_level_data, clear
    merge m:1 child_age using growth_curve_data.dta, keepusing(vars to bring over) keep(match master) gen(merge_growth)
    Last edited by David Benson; 13 Feb 2019, 22:41.

    Comment

    Working...
    X