SAS Procedures

Help using Base SAS procedures
BookmarkSubscribeRSS Feed
timothy19
Fluorite | Level 6

Hi Everyone, 

 

I need your help to be able to use the appropriate statistical procedure for my dataset below

Here is the detail of the data.
sub_id = subjects, measurement is taken on subject at different time point.
position: where measurement is taken (anterior or posterior)
time_in_seconds: time to apply treatment
resistant:
force: force of treatment application
The y variable is whether there is a block after treatment has been applied i.e. y =1 or there is a gap y= 0 and it also contains missing data.

 

Question:
I want to know how Time+Force+resistance affect the outcome i.e y =gap/block

 

Sub_IDPositionTime_in_SecondsResistance_ ohmsForce_Ny_variable
1Ant3.82-23371
1Ant4.94-244.40
1Ant3.49-41.515.81
1Ant3.07-39.521.151
1Post3.43-39291
1Post3.53-45.514.151
1Post4.44-469.551
1Post3.37-1912.91
1Ant3.35-46.57.21
1Ant3.19-4314.21
1Ant3.61-4124.551
1Ant4.24-4823.151
1Post2.09-3327.251
1Post2.83-3221.21
1Post3.26-2829.70
1Post3.34-41.510.151
2Ant5.29-3010.91
2Ant4.22-2911.31
2Ant2.40-1510.21
2Ant3.32-18.58.751
2Post1.85-279.31
2Post4.31-378.751
2Post1.82-29.513.951
2Post3.98-24.59.80
2Ant4.06-39.521.451
2Ant2.90-35.516.51
2Ant3.23-35.518.21
2Ant4.24-3114.31
2Post2.45-319.61
2Post3.51-2061
2Post4.27-17.58.41
2Post2.67-25.5250
3Ant3.065092996-4010.71
3Ant3.74-3817.8.
3Ant3.61-2710.10
3Ant2.08-26.56.45.
3Post2.12-3520.41
3Post3.244-3927.51
3Post4.02-4219.91
3Post1.94-1916.61
3Ant4.37-144.20
3Ant4.68-336.90
3Ant3.35-30.58.651
3Ant1.72-3314.11
3Post0.81-2712.21
3Post3.90-2618.351
3Post4.19-299.41
3Post4.46-1910.21
4Ant2.89-4211.31
4Ant2.20-2812.451
4Ant2.97-3119.51
4Ant2.06-3122.31
4Post3.35-44.532.91
4Post2.10-3515.31
4Post3.42-358.351
4Post4.16-3320.91
4Ant4.06-15.561
4Ant5.00-2521.51
4Ant4.13-33.524.251
4Ant5.56-3416.71
4Post4.14-3531.751
4Post4.49-33.525.41
4Post4.17-2941.91
4Post3.85-2828.81
5Ant2.67-2328.20
5Ant1.68-2310.31
5Ant2.07-19.59.851
5Ant1.06-2512.71
5Post5.02-3110.40
5Post2.53-2311.71
5Post3.40-71.527.151
5Post4.78-41.531.851
5Ant2.15-4215.951
5Ant2.89-26.516.91
5Ant2.25-339.81
5Ant2.76-2812.10
5Post3.04-2291
5Post4.45-37.59.251
5Post4.10-20.515.31
5Post4.41-31.518.051
6Ant1.61-2618.71
6Ant1.68-267.40
6Ant3.93-297.40
6Ant4.45-21.59.15.
6Post5.48-2825.051
6Post4.11-4830.71
6Post3.20-2322.31
6Post2.77-2815.31
6Ant2.34-2210.951
6Ant2.25-306.21
6Ant4.16-24.56.6 
6Ant4.62-33120
6Post2.32-3116.651
6Post4.03-31191
6Post3.43-1712.
6Post3.51-1411.10
7Ant2.99-307.651
7Ant1.80517419-2515.951
7Ant2.106053494-3213.81
7Ant3.096114016-2917.551
7Post3.167542074-2411.451
7Post3.338268984-2422.71
7Post2.659685183-32.521.951
7Post3.751749917-178.251
7Ant2.197529839-258.80
7Ant3.664137015-3510.10
7Ant3.545702335-399.40
7Ant2.023625001-3510.11
7Post2.372086883-3324.251
7Post3.582104056-37.517.31
7Post3.45055168-3812.61
7Post3.841677068-239.81
8Ant3.432008272-2518.60
8Ant2.136605495-32.514.11
8Ant1.841190586-1870
8Ant2.15865836-25.56.80
8Post3.359805409-3015.51
8Post3.631259765-31281
8Post4.674356585-32.520.91
8Post4.044977037-2512.90
8Ant3.346860731-2814.61
8Ant3.850582629-4624.51
8Ant5.340021635-31.58.51
8Ant3.980653721-2611.61
8Post3.704121331-2614.81
8Post3.848852913-31.515.81
8Post4.939191479-189.81
8Post3.134066196-159.11
9Ant1.309024248-2591
9Ant3.369404446-2711.551
9Ant1.841284373-2613.151
9Ant3.675231524-2112.41
9Post3.06826061-2224.21
9Post3.59966626-1917.31
9Post4.466268907-16.515.71
9Post1.882204503-2711.3.
9Ant3.89896461-2521.11
9Ant2.295202494-2691
9Ant3.272687389-24.54.950
9Ant4.201883396-132.70
9Post4.374845784-2510.80
9Post4.459715564-15.511.81
9Post3.227763303-19.521.050
9Post2.517233031-20.531.61
4 REPLIES 4
PGStats
Opal | Level 21

This may serve as a starting point for anyone wishing to tackle this question:

 

data have;
infile datalines truncover;
input ID Position $ Time Resistance Force y;
datalines;
1   Ant 3.82    -23 37  1
1   Ant 4.94    -24 4.4 0
1   Ant 3.49    -41.5   15.8    1
1   Ant 3.07    -39.5   21.15   1
1   Post    3.43    -39 29  1
1   Post    3.53    -45.5   14.15   1
1   Post    4.44    -46 9.55    1
1   Post    3.37    -19 12.9    1
1   Ant 3.35    -46.5   7.2 1
1   Ant 3.19    -43 14.2    1
1   Ant 3.61    -41 24.55   1
1   Ant 4.24    -48 23.15   1
1   Post    2.09    -33 27.25   1
1   Post    2.83    -32 21.2    1
1   Post    3.26    -28 29.7    0
1   Post    3.34    -41.5   10.15   1
2   Ant 5.29    -30 10.9    1
2   Ant 4.22    -29 11.3    1
2   Ant 2.40    -15 10.2    1
2   Ant 3.32    -18.5   8.75    1
2   Post    1.85    -27 9.3 1
2   Post    4.31    -37 8.75    1
2   Post    1.82    -29.5   13.95   1
2   Post    3.98    -24.5   9.8 0
2   Ant 4.06    -39.5   21.45   1
2   Ant 2.90    -35.5   16.5    1
2   Ant 3.23    -35.5   18.2    1
2   Ant 4.24    -31 14.3    1
2   Post    2.45    -31 9.6 1
2   Post    3.51    -20 6   1
2   Post    4.27    -17.5   8.4 1
2   Post    2.67    -25.5   25  0
3   Ant 3.065092996 -40 10.7    1
3   Ant 3.74    -38 17.8    .
3   Ant 3.61    -27 10.1    0
3   Ant 2.08    -26.5   6.45    .
3   Post    2.12    -35 20.4    1
3   Post    3.244   -39 27.5    1
3   Post    4.02    -42 19.9    1
3   Post    1.94    -19 16.6    1
3   Ant 4.37    -14 4.2 0
3   Ant 4.68    -33 6.9 0
3   Ant 3.35    -30.5   8.65    1
3   Ant 1.72    -33 14.1    1
3   Post    0.81    -27 12.2    1
3   Post    3.90    -26 18.35   1
3   Post    4.19    -29 9.4 1
3   Post    4.46    -19 10.2    1
4   Ant 2.89    -42 11.3    1
4   Ant 2.20    -28 12.45   1
4   Ant 2.97    -31 19.5    1
4   Ant 2.06    -31 22.3    1
4   Post    3.35    -44.5   32.9    1
4   Post    2.10    -35 15.3    1
4   Post    3.42    -35 8.35    1
4   Post    4.16    -33 20.9    1
4   Ant 4.06    -15.5   6   1
4   Ant 5.00    -25 21.5    1
4   Ant 4.13    -33.5   24.25   1
4   Ant 5.56    -34 16.7    1
4   Post    4.14    -35 31.75   1
4   Post    4.49    -33.5   25.4    1
4   Post    4.17    -29 41.9    1
4   Post    3.85    -28 28.8    1
5   Ant 2.67    -23 28.2    0
5   Ant 1.68    -23 10.3    1
5   Ant 2.07    -19.5   9.85    1
5   Ant 1.06    -25 12.7    1
5   Post    5.02    -31 10.4    0
5   Post    2.53    -23 11.7    1
5   Post    3.40    -71.5   27.15   1
5   Post    4.78    -41.5   31.85   1
5   Ant 2.15    -42 15.95   1
5   Ant 2.89    -26.5   16.9    1
5   Ant 2.25    -33 9.8 1
5   Ant 2.76    -28 12.1    0
5   Post    3.04    -22 9   1
5   Post    4.45    -37.5   9.25    1
5   Post    4.10    -20.5   15.3    1
5   Post    4.41    -31.5   18.05   1
6   Ant 1.61    -26 18.7    1
6   Ant 1.68    -26 7.4 0
6   Ant 3.93    -29 7.4 0
6   Ant 4.45    -21.5   9.15    .
6   Post    5.48    -28 25.05   1
6   Post    4.11    -48 30.7    1
6   Post    3.20    -23 22.3    1
6   Post    2.77    -28 15.3    1
6   Ant 2.34    -22 10.95   1
6   Ant 2.25    -30 6.2 1
6   Ant 4.16    -24.5   6.6  
6   Ant 4.62    -33 12  0
6   Post    2.32    -31 16.65   1
6   Post    4.03    -31 19  1
6   Post    3.43    -17 12  .
6   Post    3.51    -14 11.1    0
7   Ant 2.99    -30 7.65    1
7   Ant 1.80517419  -25 15.95   1
7   Ant 2.106053494 -32 13.8    1
7   Ant 3.096114016 -29 17.55   1
7   Post    3.167542074 -24 11.45   1
7   Post    3.338268984 -24 22.7    1
7   Post    2.659685183 -32.5   21.95   1
7   Post    3.751749917 -17 8.25    1
7   Ant 2.197529839 -25 8.8 0
7   Ant 3.664137015 -35 10.1    0
7   Ant 3.545702335 -39 9.4 0
7   Ant 2.023625001 -35 10.1    1
7   Post    2.372086883 -33 24.25   1
7   Post    3.582104056 -37.5   17.3    1
7   Post    3.45055168  -38 12.6    1
7   Post    3.841677068 -23 9.8 1
8   Ant 3.432008272 -25 18.6    0
8   Ant 2.136605495 -32.5   14.1    1
8   Ant 1.841190586 -18 7   0
8   Ant 2.15865836  -25.5   6.8 0
8   Post    3.359805409 -30 15.5    1
8   Post    3.631259765 -31 28  1
8   Post    4.674356585 -32.5   20.9    1
8   Post    4.044977037 -25 12.9    0
8   Ant 3.346860731 -28 14.6    1
8   Ant 3.850582629 -46 24.5    1
8   Ant 5.340021635 -31.5   8.5 1
8   Ant 3.980653721 -26 11.6    1
8   Post    3.704121331 -26 14.8    1
8   Post    3.848852913 -31.5   15.8    1
8   Post    4.939191479 -18 9.8 1
8   Post    3.134066196 -15 9.1 1
9   Ant 1.309024248 -25 9   1
9   Ant 3.369404446 -27 11.55   1
9   Ant 1.841284373 -26 13.15   1
9   Ant 3.675231524 -21 12.4    1
9   Post    3.06826061  -22 24.2    1
9   Post    3.59966626  -19 17.3    1
9   Post    4.466268907 -16.5   15.7    1
9   Post    1.882204503 -27 11.3    .
9   Ant 3.89896461  -25 21.1    1
9   Ant 2.295202494 -26 9   1
9   Ant 3.272687389 -24.5   4.95    0
9   Ant 4.201883396 -13 2.7 0
9   Post    4.374845784 -25 10.8    0
9   Post    4.459715564 -15.5   11.8    1
9   Post    3.227763303 -19.5   21.05   0
9   Post    2.517233031 -20.5   31.6    1
;

proc sort data=have; by position id; run;

proc sgscatter data=have;
where resistance gt -50; /* remove outlier */
by position;
matrix force time resistance / group=y;
run;

PGStats_0-1667593566619.png

PGStats_1-1667593615842.png

 

 

PG
PaigeMiller
Diamond | Level 26

I would start by performing a logistic regression. (PROC LOGISTIC)

 

--
Paige Miller
Ksharp
Super User

It is repeated measured model, therefore you need Mixed Model of Logistic.

@SteveDenham  @lvm @StatDave  could give you right sas code .

But you better to post it at Stat forum.

 

https://communities.sas.com/t5/Statistical-Procedures/bd-p/statistical_procedures

sas-innovate-white.png

Join us for our biggest event of the year!

Four days of inspiring keynotes, product reveals, hands-on learning opportunities, deep-dive demos, and peer-led breakouts. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 846 views
  • 3 likes
  • 4 in conversation