Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
MattM
Contributor
Contributor

T-Tests and Set Analysis

I have a data set with a series of patient encounters where the patient went from a hospital into a nursing facility and the number of days they stayed in the nursing facility like this:

PatientHospitalNursing FacilityDays
1Hospital AFacility 120
2Hospital AFacility 112
3Hospital BFacility 123
4Hospital BFacility 245

And it's rolled up like this:

HospitalNursing FacilityAverage Length of Stay
Hospital AFacility 135
Hospital AFacility 232
Hospital BFacility 222
Hospital CFacility 325
Hospital CFacility 145

 

And I've brought in some comparison data as well where both the Hospital and Nursing Facility are labelled 'Comparison':

HospitalNursing FacilityAverage Length of Stay
Hospital AFacility 135
Hospital AFacility 232
Hospital BFacility 222
Hospital CFacility 325
Hospital CFacility 145
ComparisonComparison24

What I want to do is add a column that  gives me whether the current row is statistically significantly different than the comparison data with a t-test:

HospitalNursing FacilityAverage Length of Stayp value of difference from comparison
Hospital AFacility 135.002
Hospital AFacility 232.007
Hospital BFacility 222.2
Hospital CFacility 325.4
Hospital CFacility 145.000001
ComparisonComparison24-

And I'm having trouble with the set analysis necessary to make this happen. TTest_sig requires a group field, and a value field. Those should be the NursingFacility and LegnthOfStay. It also requires that the group field have 2 and only 2 groups in it. What I want to do conceptually is something like this:

    TTest_sig({<current row>+<comparison data>} NursingFacility,LengthOfStay)

But the set analysis syntax totally escapes me. Any help would be very much appreciated.

Labels (2)
0 Replies