From: Michael Bryce Herrington on
Hello All.

I would like to predict the probabilities of the order in which each of n
employees come in to work, 1st, 2nd, 3rd. Based off of variables like
waking time (in min before work begins), distance to place of employment
(miles), commute method (categorical 1 =bus, 2=train, etc), avg commute time
( in min), average previous arrival time ( in min before/after work begins,
- implies tardiness), etc. Place of Work (poe) is different in each case, so
the employees are not the same, neither is the number of employees to be
looked at. The below example "kinda" works. But it seems to be giving me
results like this:
response=1 then P(employee is 1st)
response=2 then P(employee is 1st or 2nd)
response=3 then P(employee is 1st, 2nd, 3rd)

But what I really want is:
response=1 then P(employee is 1st) denoted P(1st)
response=2 then P(employee is 2nd) P(2nd)
response=3 then P(employee is 3rd) P(3rd)

and it does not output response=4 which indicates employee did not come in
1st, 2nd, or 3rd; this is alright but not perfect. Now of course I want
P(1st)+P(2nd)+P(3rd)+P(response=4)=1, but I also want the sum of the
probabilities across a place of employment to equal 1. In other words,
let i=1 to n, where n=number of employees being "tested" I want:

SUM[ P_i (1st), i=1 to n]=1

Is there a way we can group them together like this? This was difficult for
me to write, if I need to explain it more clearly let me know. The basic
idea is: Can I group multiple observations (rows in SAS) in a logistic
model so that the model knows that they are ONE EVENT? Thanks!

*

data* sample;

input poe arrivalpos waketime dist cmethod ctime prevarrival;

datalines;

1 1 45 .2 5 4 6

1 2 94 18 2 33 15

1 3 60 6 3 14 -3

2 1 90 15 3 22 10

2 2 38 1.1 4 8 7

2 3 65 17 3 25 -1

2 4 45 3 3 10 3

3 1 75 9 3 16 7

3 2 80 14 2 25 11

3 3 65 3 4 17 6

3 4 38 4 1 11 1

3 5 15 2.5 3 2 -5

;
*

data* sample;

set sample;

if arrivalpos=*1* then response=*1*;

else if arrivalpos=*2* then response=*2*;

else if arrivalpos=*3* then response=*3*;

else response=*4*;
*

run*;
*

proc* *logistic* data=sample;

model response = waketime dist cmethod ctime prevarrival;

output out=temp p=phat;
*

run*;


--
Bryce Herrington
Clemson University
mherrin(a)g.clemson.edu
(863) 258-4758