Scénario de test & Cas d'usage
Erstellung eines Datensatzes mit fehlenden Werten, negativen Gewichten und Umfrageantworten.
| 1 | DATA casuser.risk_survey; |
| 2 | INPUT id income survey_q1 survey_q2 reliability_weight; |
| 3 | DATALINES; |
| 4 | 1 50000 5 4 1.0 |
| 5 | 2 . 3 3 0.8 |
| 6 | 3 60000 4 . 1.2 |
| 7 | 4 45000 2 2 -0.5 |
| 8 | 5 80000 5 5 1.5 |
| 9 | 6 30000 1 2 0.9 |
| 10 | ; |
| 11 | RUN; |
| 1 | PROC CAS; |
| 2 | SIMPLE.correlation / |
| 3 | TABLE={name='risk_survey'} |
| 4 | inputs={{name='survey_q1'}, {name='survey_q2'}, {name='income'}} |
| 5 | weight='reliability_weight' |
| 6 | listwiseDelMiss=true |
| 7 | excludeNonPosWgt=true |
| 8 | alpha=true |
| 9 | descriptiveStats=true; |
| 10 | RUN; |
Beobachtung 2 (fehlendes Einkommen) und Beobachtung 3 (fehlendes Q2) werden ignoriert (listwise deletion). Beobachtung 4 wird ignoriert (negatives Gewicht). Cronbachs Alpha wird nur auf Basis der validen, positiv gewichteten Datensätze berechnet.