Hello,
I trying to convert table "Have" into table "Want". I have multiple tables "Have" with different number of steps in them and looking for an automated way to determine the number of steps.
Table "Have"
step
Variable
Estimate
Odd_Ratio
0
INTERCEPT
2.2168
9.178 (2.62, 32.149)
0
PRIOR_CSA
-0.6381
0.528 (0.236, 1.18)
0
MALE
-0.4896
0.613 (0.319, 1.176)
0
EASI0141
-0.00831
0.992 (0.966, 1.018)
0
AAGE
0.017
1.017 (0.993, 1.042)
0
EASI0142
0.00382
1.004 (0.96, 1.05)
1
INTERCEPT
2.2368
9.363 (2.737, 32.037)
1
PRIOR_CSA
-0.6275
0.534 (0.241, 1.182)
1
MALE
-0.4894
0.613 (0.32, 1.176)
1
EASI0141
-0.00638
0.994 (0.98, 1.008)
1
AAGE
0.017
1.017 (0.993, 1.042)
2
INTERCEPT
1.9037
6.711 (2.531, 17.794)
2
PRIOR_CSA
-0.7005
0.496 (0.228, 1.081)
2
MALE
-0.5303
0.588 (0.309, 1.122)
2
AAGE
0.018
1.018 (0.994, 1.043)
Desired format:
Table "Want"
step
Variable
Estimate_0
Odd_Ratio_0
Estimate_1
Odd_Ratio_1
Estimate_2
Odd_Ratio_2
ProbChiSq_2
0
INTERCEPT
2.2168
9.178 (2.62, 32.149)
2.2368
9.363 (2.737, 32.037)
1.9037
6.711 (2.531, 17.794)
0.0001
0
PRIOR_CSA
-0.6381
0.528 (0.236, 1.18)
-0.6275
0.534 (0.241, 1.182)
-0.7005
0.496 (0.228, 1.081)
0.0776
0
MALE
-0.4896
0.613 (0.319, 1.176)
-0.4894
0.613 (0.32, 1.176)
-0.5303
0.588 (0.309, 1.122)
0.1072
0
EASI0141
-0.00831
0.992 (0.966, 1.018)
-0.00638
0.994 (0.98, 1.008)
0.018
1.018 (0.994, 1.043)
0.1364
0
AAGE
0.017
1.017 (0.993, 1.042)
0.017
1.017 (0.993, 1.042)
0
EASI0142
0.00382
1.004 (0.96, 1.05)
... View more