|
VALUE COUNTName:
<SUBSET/EXCEPT/FOR qualification> where <x1> is the variable for which the size is to be computed; <par> is a parameter where the size is saved; and where the <SUBSET/EXCEPT/FOR qualification> is optional.
LET NVAL = VALUE COUNT Y
before entering the VALUE COUNT command.
Note that the VALUE COUNT statistic can also be computed using
However, the VALUE COUNT command becomes more convenient when used with these various statistics. In particular, it is useful for obtaining counts with the various cross tabulation statistics. This is demonstrated in the Program 2 example below.
let y = normal rand numb for i = 1 1 100
let y2 = y
let y2 = 3 subset y > 3
let y2 = -3 subset y < -3
.
let xvalue = 3
let nouth = value count y2
let xvalue = -3
let noutl = value count y2
.
set write decimals 3
print nouth noutl
The following output is generated.
PARAMETERS AND CONSTANTS--
NOUTH -- 0.000
NOUTL -- 1.000
Program 2:
skip 25
read ripken.dat y x1 x2
let yout = y
let yout = -1 subset y < 0.2
let yout = 1 subset y > 0.4
.
set let cross tabulate collapse
let x1id = cross tabulate group one x1 x2
let x2id = cross tabulate group two x1 x2
let ycnt = cross tabulate size x1 x2
let xvalue = -1
let ylow = cross tabulate value count yout x1 x2
let xvalue = 1
let yhigh = cross tabulate value count yout x1 x2
.
set write decimals 0
print ycnt ylow yhigh x1id x2id
The following output is generated.
---------------------------------------------------------------------------
YCNT YLOW YHIGH X1ID X2ID
---------------------------------------------------------------------------
4 2 0 1 1
4 0 0 1 2
4 1 0 1 3
4 0 0 2 1
4 0 3 2 2
4 0 1 2 3
4 4 0 3 1
4 1 0 3 2
4 1 0 3 3
|
Privacy
Policy/Security Notice
NIST is an agency of the U.S.
Commerce Department.
Date created: 06/23/2014 | ||||||