Help on ^fold^: Fold or block a data set 
-----------------------------------------------------------
Joseph Hilbe, Editor, STB


The syntax for ^fold^ is:

             ^fold^  pos_var pop_var match [rhsvar]

^pos_var^ represents a variable coded as 0 (failure) or 1 (success). 
^pop_var^ consists of the number of cases having the same covariate 
pattern and pos_var. A matching variable is required when folding or 
blocking a data set. This allows the program to identify which variables 
belong to the same group. Right-hand-side covariates will be appropriately 
handled; you do not need to name them on the command line.  


Consider the following example ungrouped data set. The order of variables 
in the data set makes no difference to the ^fold^ command.




            cd4        cd8      match     infec      cases  
  1.         1          2          1         0          0  
  2.         0          0          2         0          3  
  3.         2          2          3         0          2  
  4.         2          0          4         0          2  
  5.         1          2          1         1          2  
  6.         0          0          2         1          4  
  7.         2          2          3         1          1  
  8.         2          0          4         1          0  

Now type...

^. fold infec cases match
Data set folded...

^.l

           cd4        cd8      match     _infec     _cases  
  1.         1          2          1          2          2  
  2.         0          0          2          4          7  
  3.         2          2          3          1          3  
  4.         2          0          4          0          2  


The program drops the original variables; they make no sense in a 
blocked format. However, it does retain the ^match^ variable. The new 
variables representing groups have the same name as the originals - except 
for a leading underscore. Rename the underscored variables if you like; 
and delete ^match^. I put them as such to show their origin. 


