Lab 5 Question 13

Lab 5 Question 13

by Katherine Dang -
Number of replies: 3

Hello,

I am having an issue with the command for mhodds in question 13. I keep getting "age_ge60 unknown weight type" as an error. My command is as follows:

mhodds dead anycac [age_ge60], by(sex)

Please let me know what is wrong with my syntax. 

 

Thanks

 

In reply to Katherine Dang

Re: Lab 5 Question 13

by Joseph Musana -

Katherine

syntax is mhodds dead anycac (age_ge60), by (male)

Joseph

In reply to Joseph Musana

Re: Lab 5 Question 13

by Mark Pletcher -

Two comments on the syntax:

1) I use brackets "[ ]" when I DESCRIBE a command to indicate what part of the command is OPTIONAL.  Stata uses the same convention in its Help menus.  So you almost NEVER actually type in brackets into a command.  An exception to this is when you want to use statistical weights of some sort (that's why the error message Katherine got mentions weights), but we don't need to deal with that in Biostat 212.

2) The syntax that Joseph sent is also just a bit off - there shouldn't be any parentheses before the comma in that command.  Interesting to see that it still worked!  It's sometimes hard to predict what kind of things Stata is going to let slide, and what it will flag with an error.

The correct syntax for that command is:

mhodds dead anycac age_ge60, by(male)