I have just realized something when developing a program to do a likelihood ratio test on the boundary. I wanted to check whether the arguments passed (log-likelihoods of the restricted --nested-- model and of the unrestricted --containing-- model) were numbers. When I checked help confirm I saw that you had the following options that deals with numbers:
I'm sure that there are reasons for both options. Can someone tell me if there's an easier way to check if an argument passed into a program is a number independent of how it's stored by the user?
- confirm [numeric | string | date] format string
- confirm [integer] number string
- confirm scalar string
Code:
capture confirm scalar `llr' if _rc { capture confirm number `llr' if _rc { di as error "llr has to be a number" error 198 } }
Comment