.-
help for ^nvars^
.-

Number of variables - -------------------

^nvars^ [stub] Description - -----------

^nvars^ counts the number of variables.

If a stub is specified, ^nvars^ counts the number of variables with names beginning with stub, that is stub^*^. ^nvars^ accepts both stub and stub^*^ as input.

If no stub is specified, ^nvars^ counts the number of variables in the data set.

Examples - --------

. ^nvars^ testing in a program that ^myvar*^ just includes ^myvar^: . ^qui nvars myvar^ . ^if r(nvars) == 1 {^ ... ^}^

Author - ------

Nicholas J. Cox, University of Durham, U.K. n.j.cox@@durham.ac.uk