Resources

Getting Started Example 7 for PROC RELIABILITY


/****************************************************************/
/*          S A S   S A M P L E   L I B R A R Y                 */
/*                                                              */
/*    NAME: RELGS7                                              */
/*   TITLE: Getting Started Example 7 for PROC RELIABILITY      */
/* PRODUCT: QC                                                  */
/*  SYSTEM: ALL                                                 */
/*    KEYS: reliability, lifetime data                          */
/*   PROCS: RELIABILITY                                         */
/*    DATA:                                                     */
/*                                                              */
/* SUPPORT: sasgjj                                              */
/*     REF: PROC RELIABILITY, INTRODUCTORY EXAMPLE 7.           */
/*    MISC:                                                     */
/****************************************************************/

data Grids;
   if _N_ < 40 then Sample = 'Sample1';
   else Sample = 'Sample2';
   input ID$ Days Value @@;
   datalines;
S1-01 462  1    S1-01 730 -1    S1-02 364  1    S1-02 391  1
S1-02 548  1    S1-02 724 -1    S1-03 302  1    S1-03 444  1
S1-03 500  1    S1-03 730 -1    S1-04 250  1    S1-04 730 -1
S1-05 500  1    S1-05 724 -1    S1-06  88  1    S1-06 724 -1
S1-07 272  1    S1-07 421  1    S1-07 552  1    S1-07 625  1
S1-07 719 -1    S1-08 481  1    S1-08 710 -1    S1-09 431  1
S1-09 710 -1    S1-10 367  1    S1-10 710 -1    S1-11 635  1
S1-11 650  1    S1-11 708 -1    S1-12 402  1    S1-12 700 -1
S1-13  33  1    S1-13 687 -1    S1-14 287  1    S1-14 687 -1
S1-15 317  1    S1-15 498  1    S1-15 657 -1    S2-01 203  1
S2-01 211  1    S2-01 277  1    S2-01 373  1    S2-01 511 -1
S2-02 293  1    S2-02 503 -1    S2-03 173  1    S2-03 470 -1
S2-04 242  1    S2-04 464 -1    S2-05  39  1    S2-05 464 -1
S2-06  91  1    S2-06 462 -1    S2-07 119  1    S2-07 148  1
S2-07 306  1    S2-07 461 -1    S2-08 382  1    S2-08 460 -1
S2-09 250  1    S2-09 434 -1    S2-10 192  1    S2-10 448 -1
S2-11 369  1    S2-11 448 -1    S2-12  22  1    S2-12 447 -1
S2-13  54  1    S2-13 441 -1    S2-14 194  1    S2-14 432 -1
S2-15  61  1    S2-15 419 -1    S2-16  19  1    S2-16 185  1
S2-16 419 -1    S2-17 187  1    S2-17 416 -1    S2-18  93  1
S2-18 205  1    S2-18 264  1    S2-18 415 -1
;
proc print data=Grids(obs=20);
run;
proc reliability data=Grids;
   unitid ID;
   mcfplot Days*Value(-1) = Sample / mcfdiff;
run;
data Predict;
   Control=1;
   if _N_ < 7 then Sample = 'Sample1';
   else Sample = 'Sample2';

   input ID$ Days Value;
   cards;
9999 500  .
9999 600  .
9999 700  .
9999 800  .
9999 900  .
9999 1000 .
9999 500  .
9999 600  .
9999 700  .
9999 800  .
9999 900  .
9999 1000 .
;

data Grids;
   set Predict Grids;
run;
proc reliability data=Grids;
   unitid ID;
   distribution nhpp(pow);
   class Sample;
   model   Days*Value(-1) = Sample /obstats(control=Control);
   mcfplot Days*Value(-1) = Sample /fit=model overlay;
run;