Counting how many subjects have records satisfying a condition
--------------------------------------------------------------

^longch^ idname [^if^ exp] [^in^ range], ^c(^string^)^

Description -----------

The command ^longch^ is used with data in which their are several records per subject. The variable ^idname^ identifies the subjects, and the string in ^c()^ contains a logical condition. The program reports the number of subjects for which some records satisfy the condition; the number for which no records satisfy the condition; and the number of subjects for which every record satisfies the condition. In addition the logical variables ^_some^, ^_none^ and ^_every^ which flag the records are created. This is useful for dropping all records belonging to subjects of a particular type, eg those with no records satisfying the condition.

Options -------

^c()^ is not an option - it contains a logical condition

Example -------

Consider a longitudinal data set in which each record corresponds to a visit by a subject and the subject identity is in the variable id. The command

^longch id, c(height == . )^

results in the output

71 records fulfill the condition height == .

some : 46 subjects have height == . in at least one record none : 51 subjects have height == . in no records every: 0 subjects have height == . in every record

In addition three logical variables called ^_some^, ^_none^, and ^_every^, are created for convenience in further manipulation (eg dropping or keeping records). These flag all records belonging to subjects with some records satisfying the condition, and so on.

Authors -------

Michael Hills mhills@@regress.demon.co.uk

Tony Brady tbrady@@rpms.ac.uk

Also see --------

On-line: help for @count@, @unique@