|
STATISTIC MISSING VALUEName:
In computing a simple statistic LET sub-command such as
it is relatively easy to omit missing values with a SUBSET clause. For example
You can also do this with the commands
Although in this simple case there is no need to use the SET STATISTIC MISSING VALUE, there are 20+ commands (such as CROSS TABULATE, STATISTIC PLOT) that utilize the built-in statistics. In these cases, using the SET STATISTIC MISSING VALUE can be more convenient than using the SUBSET clause. Enter HELP STATISTICS for a list of built-in statistics and the commands that can utilize them.
where <value> is a number or parameter that specifies a value that will be interpreted as a missing value code.
SET STATISTIC MISSING VALUE -1
read matrix m
2 4 7 -9999
2 -9999 2 3
1 2 -9999 3
end of data
.
set statistic missing value -9999
.
let meanv = matrix row mean m
.
set write decimals 3
print meanv
The following output is generated.
---------------
MEANV
---------------
4.333
2.333
2.000
Program 2:
let n1 = 105
let n2 = 192
let n3 = 145
let n = n1 + n2 + n3
let x = 3 for i = 1 1 n
let x = 1 for i = 1 1 n1
let istrt = n1 + 1
let istop = n1 + n2
let x = 2 for i = istrt 1 istop
.
set statistic missing value -99
.
. Group 1 values
.
let y1 = 0 for i = 1 1 n
let y2 = 0 for i = 1 1 n
let y1 = 1 for i = 1 1 81
let y2 = 1 for i = 1 1 34
.
. Group 2 values (have unequal samples here, so fill
. with missing values
.
let istrt = n1 + 1
let istop1 = istrt + 118 - 1
let istop2 = istrt + 69 - 1
let y1 = 1 for i = istrt 1 istop1
let y2 = 1 for i = istrt 1 istop2
let istrt2 = n1 + 174 + 1
let istop2 = n1 + n2
let y2 = -99 for i = istrt2 1 istop2
.
. Group 3 values
.
let istrt = n1 + n2 + 1
let istop1 = istrt + 82 - 1
let istop2 = istrt + 52 - 1
let y1 = 1 for i = istrt 1 istop1
let y2 = 1 for i = istrt 1 istop2
.
odds ratio chi-square test y1 y2 x
The following output is generated.
Summary of Log(Odds Ratio)
---------------------------------------------------------------------------------------------
| Log of Standard
| Odds Ratio Odds Ratio Error 1/SE(L(i))**2 w(i)*
Group | O(i) L(i) SE(L(i)) w(i) L(i)**2
---------------------------------------------------------------------------------------------
1 | 6.894114 1.930668 0.3099319 10.41040 38.80455
2 | 2.414514 0.8814980 0.2138429 21.86806 16.99233
3 | 2.313836 0.8389067 0.2400251 17.35748 12.21558
---------------------------------------------------------------------------------------------
Total | 49.63594 68.01245
Chi-Square Analysis of Log(Odds Ratio)
Number of Groups: 3
Estimate of Combined Log(Odds Ratio): 1.086652
Standard Error of Combined Log(Odds Ratio): 0.1419390
Chi-Square Test Statistic (Total): 68.01245
Degrees of Freeedom: 3
CDF of Test Statistic: 1.000000
Chi-Square Test Statistic (Association): 58.61072
Degrees of Freedom: 1
CDF of Test Statistic: 1.000000
Chi-Square Test Statistic (Homogeneity): 9.401734
Degrees of Freedom: 2
CDF of Test Statistic: 0.9978321
Chi-Square Test for Consistency of Association (Homogeneity)
---------------------------------------------------------------------------
Null Hypothesis Null
Null Confidence Critical Acceptance Hypothesis
Hypothesis Level Value Interval Conclusion
---------------------------------------------------------------------------
Consistent 50.0% 1.39 (0,0.500) REJECT
Consistent 80.0% 3.22 (0,0.800) REJECT
Consistent 90.0% 4.61 (0,0.900) REJECT
Consistent 95.0% 5.99 (0,0.950) REJECT
Consistent 97.5% 7.38 (0,0.975) REJECT
Consistent 99.0% 9.21 (0,0.990) REJECT
Chi-Square Test for Overall Degree of Association
---------------------------------------------------------------------------
Null Hypothesis Null
Null Confidence Critical Acceptance Hypothesis
Hypothesis Level Value Interval Conclusion
---------------------------------------------------------------------------
No Association 50.0% 0.45 (0,0.500) REJECT
No Association 80.0% 1.64 (0,0.800) REJECT
No Association 90.0% 2.71 (0,0.900) REJECT
No Association 95.0% 3.84 (0,0.950) REJECT
No Association 97.5% 5.02 (0,0.975) REJECT
No Association 99.0% 6.63 (0,0.990) REJECT
Large Sample Confidence Interval for Log(Odds Ratio)
---------------------------------------------------------------------------------------------------------
Log(Odds Ratio) Odds Ratio
( 1.086652 ) ( 2.964332 )
Confidence Lower Upper Lower Upper
Value (%) Limit Limit Limit Limit
---------------------------------------------------------------------------------------------------------
50.00 0.9909154 1.182388 2.693699 3.262156
80.00 0.9047496 1.268554 2.471313 3.555707
90.00 0.8531829 1.320121 2.347105 3.743874
95.00 0.8084564 1.364847 2.244441 3.915125
97.50 0.7685093 1.404794 2.156549 4.074689
99.00 0.7210411 1.452263 2.056573 4.272771
|
Privacy
Policy/Security Notice
NIST is an agency of the U.S.
Commerce Department.
Date created: 06/04/2016 | |||||||||||||