-
Latest posts by kc
Subject Views Posted 2394 08-28-2024 11:25 AM 2765 08-16-2024 12:00 PM 2942 08-13-2024 08:10 AM 2987 08-13-2024 12:03 AM 3216 08-09-2024 03:13 PM 3279 08-09-2024 11:22 AM 1057 07-31-2024 01:30 PM 1077 07-31-2024 12:33 PM 1159 07-30-2024 02:16 PM 808 07-02-2024 06:04 PM -
Activity Feed for kc
- Posted Re: Trend test for multinomial variable on Statistical Procedures. 08-28-2024 11:25 AM
- Posted Re: Trend test for multinomial variable on Statistical Procedures. 08-16-2024 12:00 PM
- Posted Re: Trend test for multinomial variable on Statistical Procedures. 08-13-2024 08:10 AM
- Posted Re: Trend test for multinomial variable on Statistical Procedures. 08-13-2024 12:03 AM
- Posted Re: Trend test for multinomial variable on Statistical Procedures. 08-09-2024 03:13 PM
- Posted Trend test for multinomial variable on Statistical Procedures. 08-09-2024 11:22 AM
- Posted Re: Test Proportional Hazards Assumption in Recurrent Event Model on Statistical Procedures. 07-31-2024 01:30 PM
- Posted Re: Test Proportional Hazards Assumption in Recurrent Event Model on Statistical Procedures. 07-31-2024 12:33 PM
- Posted Test Proportional Hazards Assumption in Recurrent Event Model on Statistical Procedures. 07-30-2024 02:16 PM
- Posted at-risk table in proc phreg - recurrent event analysis on Statistical Procedures. 07-02-2024 06:04 PM
- Posted Time to multiple medication discontinuations on Statistical Procedures. 05-23-2024 04:01 PM
- Posted Re: Create multiple variables in a dataset based on the name and number of columns on SAS Programming. 04-14-2024 11:25 PM
- Posted Create multiple variables in a dataset based on the name and number of columns on SAS Programming. 04-14-2024 10:32 PM
- Liked Re: proc nlmixed - test if the interaction term is significant at a specific value of another variab for StatDave. 12-03-2023 11:46 AM
- Posted Re: proc nlmixed - test if the interaction term is significant at a specific value of another variab on Statistical Procedures. 12-03-2023 03:19 AM
- Posted Re: proc nlmixed - test if the interaction term is significant at a specific value of another variab on Statistical Procedures. 12-02-2023 03:32 PM
- Posted proc nlmixed - test if the interaction term is significant at a specific value of another variable on Statistical Procedures. 12-02-2023 01:45 AM
- Posted Re: Analysis of recurrent events - cumulative incidence curves in SAS (using the Ghosh-Lin estimator on Statistical Procedures. 10-02-2023 08:10 AM
- Posted Analysis of recurrent events - cumulative incidence curves in SAS (using the Ghosh-Lin estimator?) on Statistical Procedures. 10-02-2023 01:37 AM
- Posted Criteria for comparing statistical methods on Statistical Procedures. 05-21-2023 09:22 PM
-
Posts I Liked
Subject Likes Author Latest Post 1 4 1 -
My Liked Posts
Subject Likes Posted 1 11-22-2022 10:49 PM 1 10-15-2015 03:47 PM
08-02-2018
05:37 PM
I wonder, Why do you want a piecewise linear regression? How many breakpoints do you need? Do you know where the breakpoint(s) for the pieces is(are) (for example, at 6 months), or do you need to estimate the location(s) of the breakpoint(s)?
Well, from prior clinical knowledge, there is no significant effect of treatment on summary score beyond the 6 month timepoint. Therefore, there is need for only 2 breakpoints, one each at 1 month and 6 month. I included only one breakpoint at 6 month in my code as an example.
Is your actual dataset larger than the one you posted? (In the future, please post as a CSV file, rather than Excel.)
Yes, much larger.
Few subjects in your posted dataset have values for all 7 times (5 out of 27 subjects), and many have only 1 value (8 out of 27). Only 14 subjects have data at both 1 month and 6 months.
Correct - some subjects have summary score data at all times, and some don't. The data, although dummy, mimics the data from an actual trial. So, missing data is quite common.
Can you sensibly fit a model (with or without random slopes) for multiple linear pieces using a data set that is so incomplete? I'd say, probably not. I also would be concerned about potential bias in either ANOVA or regression models due to missing data and why data are missing.
Multiple methods (paired t-tests, ANCOVA, mixed effects models) are employed in analyzing these data. Also, an underlying assumption of longitudinal growth curve models is that the missing data is missing at random.
So, any help with the syntax in running a piecewise regression to fill the table in my original post would be great. Let me know if more data (in CSV format this time) would be helpful in carrying out this task!
... View more
08-02-2018
12:14 PM
I am trying to run piece wise linear regression on a longitudinal dataset (because growth curve modeling is giving results which are clinically not plausible at certain time points). The sample dataset is attached in excel format and has the following columns/variables
1. Subject ID
2. Clinically planned event name (total 7 time points possible for a subject - 1 month, 6 months, 1 year, 2 years, 3 years, 4 years, 5 years)
3. Time (time in years)
4. Summary Score (the dependent variable in the model)
5. m6 (dummy variable for the first 6 months)
6. post6m (dummy variable for post - 6 months)
7. Group (treatment group)
The model I currently have is as follows:
proc glimmix data=PLR; class subjectid; model summaryscore = m6 post6m/solution; random intercept m6 post6m/ subject=subjectid type=chol; run;
Here is the question I have:
How do I get mean summary score by treatment group and difference between treatment groups in mean summary score (along with 95% CI and p-values) at the 7 different time points in the study? In other words, can someone help me with the syntax to add treatment group and time, and the interaction between treatment and time as covariates in the model, to get the mean and mean difference in summary scores between treatment groups, at various time points?
Here is what I need:
Predicted Mean Values (95% CI)
Predicted Mean Difference (TRT1-TRT2), 95%CI
P-value
TRT1
TRT2
Summary Score
1 Month
xx.x (xx.x, xx.x)
xx.x (xx.x, xx.x)
xx.x (xx.x, xx.x)
0.xxxx
6 Months
xx.x (xx.x, xx.x)
xx.x (xx.x, xx.x)
xx.x (xx.x, xx.x)
0.xxxx
1 Year
xx.x (xx.x, xx.x)
xx.x (xx.x, xx.x)
xx.x (xx.x, xx.x)
0.xxxx
2 Years
xx.x (xx.x, xx.x)
xx.x (xx.x, xx.x)
xx.x (xx.x, xx.x)
0.xxxx
3 Years
xx.x (xx.x, xx.x)
xx.x (xx.x, xx.x)
xx.x (xx.x, xx.x)
0.xxxx
4 Years
xx.x (xx.x, xx.x)
xx.x (xx.x, xx.x)
xx.x (xx.x, xx.x)
0.xxxx
5 Years
xx.x (xx.x, xx.x)
xx.x (xx.x, xx.x)
xx.x (xx.x, xx.x)
0.xxxx
Any suggestions are greatly appreciated!
... View more
05-03-2017
03:18 PM
I have a health status scale measured at 2 different timepoints (baseline and 1 month) with 5 different response levels (0-4). I want to see if there is a statistically significant difference in within group change from baseline to the 1 month time point for each of these response levels. My questions are as follows:
1. Am I using the right code to accomplish this task?
2. If so, which statistics do I report to highlight if the difference is significant?
3. Finally, I think the procedure below gives an overall p-value and not a level-by-level p-value and statistics. How do I test a level by level difference between baseline and 1 month response? Like the difference between response level 0 between baseline and 1 month.
I am running the following proc freq code (analogous to paired t-test for continous variables):
proc freq data=health; tables hs_BASELINE*hs_1_MONTH / agree norow nocol nopercent; run;
The result is as follows:
SAS Output
Frequency
Table of hs_BASELINE by hs_1_MONTH
hs_BASELINE
hs_1_MONTH
0
1
2
3
4
Total
0
327
55
25
12
17
436
1
236
100
37
17
14
404
2
140
66
42
21
22
291
3
106
39
36
14
21
216
4
62
38
33
30
67
230
Total
871
298
173
94
141
1577
Frequency Missing = 325
Statistics for Table of hs_BASELINE by hs_1_MONTH
Test of Symmetry
Statistic (S)
328.8670
DF
10
Pr > S
<.0001
Kappa Statistics
Statistic
Value
ASE
95% Confidence Limits
Simple Kappa
0.1402
0.0139
0.1130
0.1674
Weighted Kappa
0.2379
0.0171
0.2044
0.2714
Effective Sample Size = 1577 Frequency Missing = 325
WARNING: 17% of the data are missing.
... View more
03-22-2017
10:51 AM
Here is a contrast statement that works: (you can write the statement for other time points in a similar fashion)
proc mixed data=growth noclprint order=formatted covtest noitprint method=reml; class group pt strata time(ref="1"); model score = baseline_score group time time*group strata group*strata time*strata time*group*strata/solution ddfm=bw notest; random pt /vcorr;
contrast 'pvalue at 1 month' group*strata 1 -1 -1 1 time*group*strata 1 0 0 0 0 0 -1 0 0 0 0 0 -1 0 0 0 0 0 1 0 0 0 0 0;
lsmeans time*group*strata/pdiff cl ;
ods output Contrasts=cont_(keep=label probf)
SolutionF=est_(keep=effect estimate stderr probt) LSMeans=lsm_(keep=effect group strata time estimate lower upper) Diffs=diff_(keep=effect group strata _group _strata time _time estimate lower upper probt); run;
... View more
03-16-2017
02:01 PM
I am running the following model to run a repeated measures ancova. the data has 2 treatment groups, 2 stratification levels and 5 time points (baseline, 1m, 6m, 12m, 24m). The dependent variable is the score at post-baseline time points (1,6,12,24 months).
My question is, how do I get an overall p-value for the 3-way interaction at each post-baseline timepoint? I am not sure of how to write a contrast statement to accomplish this? Please help!
proc mixed data=growth noclprint order=formatted covtest noitprint method=reml; class group pt strata time(ref="1"); model score = baseline_score group time time*group strata group*strata time*strata time*group*strata/solution ddfm=bw notest; random pt /vcorr;
lsmeans time*group*strata/pdiff cl ;
ods output SolutionF=est_(keep=effect estimate stderr probt) LSMeans=lsm_(keep=effect group strata time estimate lower upper) Diffs=diff_(keep=effect group strata _group _strata time _time estimate lower upper probt); run;
... View more
07-12-2016
12:30 PM
Thanks Dan! I should have probably mentioned that along with the code.Will try and see if the code works after upgrading to TS1M3 release.
... View more
07-12-2016
12:18 PM
I am using SAS 9.4 (TS1M1) - Do I need TS1M3 for the code to work (I see that on some blogs)?
... View more
07-12-2016
11:55 AM
Hi Dan,
I tried using the default escape sequence, but with no luck. The symbol does show up as its supposed to in the title and footnote statements no matter which escape sequence I use, but just not as an axis value for some reason.
... View more
07-12-2016
10:55 AM
Here is the sgplot code and the proc format code (no titles or footnote statements)
proc format library=work; value yscale 200 = 'Treatment' 160 = 'Age ^{unicode 2265} 75' 140 = 'Age < 75' 100 = 'US' 80 = 'Outside US' other = '' ; run;
ods options orientation=portrait; ODS ESCAPECHAR='^'; ods graphics on / border=off; ods rtf file='C:\Users\Z1000\Desktop\newplot.rtf' sge=on; proc sgplot data=combined sganno=anno; scatter x=meanestimate y=Order / xerrorlower=MeanLowerCL xerrorupper=MeanUpperCL markerattrs=OR (symbol=DiamondFilled size=6); refline 1/axis=x; format Order yscale.; xaxis label="Relative Rate" LABELATTRS=(Family='Arial' ) VALUEATTRS=(Family=Arial SIZE=10 ) type=LOG LOGBASE= 10 min=0.5 max=2 values = (0.5 1 2); yaxis label="SubGroups" display=(nolabel) tickvalueformat=yscale. VALUEATTRS=(Family=Arial SIZE=10 ) offsetmin=0.1 offsetmax=0.1 VALUES = (80 100 140 160 200); run; ods rtf close;
... View more
07-09-2016
04:16 PM
I am trying to display the ≥ symbol (greater than or equal to) on y-axis in a plot using the sgplot procedure. But, the ≥ symbol is replaced by just the = symbol in the RTF document produced. The ≥ symbol is part of a string in a character variable.
Any suggestions?
Thanks,
KC
... View more
05-25-2016
12:13 PM
Is it possible to display an "inset" box outside the plot area, to the right of the graph?
... View more
04-07-2016
09:31 PM
I am trying to change the order of the legend entries to match the visual order of the bar themselves using proc sgplot. I did go through one of the posts on the forums here https://communities.sas.com/t5/SAS-GRAPH-and-ODS-Graphics/SGPLOT-legend-order/m-p/193197#M7129. But SAS 9.4 doesn't seem to recognize the "sortorder=descending" option mentioned in the keylegend statement given in the example of how to match up the legend entries with the visual order (ran the code as is from the first post).
Any help is appreciated!
... View more
- Tags:
- legend order
- sgplot
10-13-2015
11:46 AM
How do I keep the scale of y-axis from 0 to 10 but only display tick values at 2 4 6 8. Essentially, I want to have 5 intervals (from 0 to 10) instead of 3, so my scatter plot is placed in the middle of the graph instead of being more spread out. My dataset has only 4 observations at (2 4 6 8). Please find an attachment with display of plots.
... View more
- « Previous
- Next »