Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

syntax command syntax issue

I’ve spent hours reading Stata help file (17SE) but I’m unable to understand why the syntax in this syntax command is wrong:

syntax, n(integer) interact(real) infage(integer min=45 max=75) supage(integer min=45 max=75)

For sure the part until interact(real) works, but what’s wrong with the following part?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

I suspect that you want something more like

syntax, n(integer) interact(real) infage(numlist integer >=45 <=75) ///
supage(numlist integer >=45 <=75)

There are two points here.

The min and max arguments are about how many elements are specified, not about what their values might be. I doubt that you want to insist that the user types in at least 45 integers to each option.

Expecting that a specification integer() would support specification of the allowed range seems reasonable enough, but nothing in the documentation supports that. It’s numlist() that allows more checking.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading