gli algoritmi sono i seguenti (ne includo una parte, se qualcuno è interessato lo incollo completo) Grazie e scusate per il disturbo
- Codice: Seleziona tutto
***************************************************************** *** INPUT DATA *** *****************************************************************
DATA SF12DATA; INFILE IN; INPUT ID $ 1-3 @ 5 (GH1 PF02 PF04 RP2 RP3 RE2 RE3 BP2 MH3 VT2 MH4 SF2) (1.0); RUN;
*****************************************************************; *** STEP 1: DATA CLEANING/REVERSE SCORING ***; *****************************************************************;
************************************************************************; * USING THE SAS DATASET CREATED IN PART 1, CHANGE OUT-OF-RANGE * * VALUES TO MISSING FOR EACH ITEM. * *************************************************************************;
DATA SF12SCAL; SET SF12DATA;
ARRAY TWOPT RP2 RP3 RE2 RE3; DO OVER TWOPT; IF TWOPT LT 1 OR TWOPT GT 2 THEN TWOPT = .; END;
ARRAY THREEPT PF02 PF04; DO OVER THREEPT; IF THREEPT LT 1 OR THREEPT GT 3 THEN THREEPT = .; END;
ARRAY FIVEPT GH1 BP2 SF2; DO OVER FIVEPT; IF FIVEPT LT 1 OR FIVEPT GT 5 THEN FIVEPT = .; END;
ARRAY SIXPT VT2 MH3 MH4; DO OVER SIXPT; IF SIXPT LT 1 OR SIXPT GT 6 THEN SIXPT = .; END;
RBP2=6-BP2; RGH1=6-GH1; RVT2=7-VT2; RMH3=7-MH3;
84
*****************************************************************; * STEP 2: CREATE INDICATOR VARIABLES FROM * * ITEM RESPONSE CHOICES * *****************************************************************; PF02_1 = .; if PF02 = . then PF02_1 = .; else if PF02 = 1 then PF02_1 = 1; else PF02_1 = 0;
PF02_2 = .; if PF02 = . then PF02_2 = .; else if PF02 = 2 then PF02_2 = 1; else PF02_2 = 0;