Announcement

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

  • anthro

    Hello!
    I downloaded the package for anthro to convert BMI to z scores
    the example looks like I need to use this code, but I am getting an error

    egen newvar = zanthro(init_bmi_calc,ba,US) xvar(init_age) gender(gender2) gencode(F=Female M=Male) ageunit(year)

    my variables are initial_bmi_calc=bmi, init_age=age, gender2=gender

    Thank you!
    Ellen

  • #2
    Please read the Forum FAQ for excellent advice on how to ask questions in a way that will maximize your chance of getting a helpful and timely response. "I am getting an error" is unhelpful: what error are you getting?

    Comment


    • #3
      Welcome to Statalist, Ellen.

      If you run the command help zanthro you will read the following:
      Code:
      Syntax
      egen [type] newvar = zanthro(varname,chart,version) [if] [in], xvar(varname) gender(varname) gencode(male=code, female=code) [ageunit(unit) gestage(varname) nocutoff
      Do note the comma that appears immediately before the xvar option; that comma is necessary to separate the list of "options" (many of which however are required) from the function name and qualifiers that appear before it. If the error message you received was
      Code:
      varlist not allowed
      r(101);
      the missing comma was likely the cause.

      Note also that the absence of the comma is more noticeable when the code is presented using CODE delimiters, as requested in the Statalist FAQ, to which Clyde referred you, which is linked to from the top of the page, as well as from the Advice on Posting link on the page you used to create your post. Do please see especially sections 9-12 on how to best pose your question.

      The more you help others understand your problem, the more likely others are to be able to help you solve your problem.

      Last edited by William Lisowski; 16 Nov 2017, 15:48.

      Comment

      Working...
      X