Levi_M Tracker
https://communities.sas.com/kntur85557/tracker
Levi_M TrackerSun, 14 Apr 2024 08:41:56 GMT2024-04-14T08:41:56ZStationarity in an Interrupted time series
https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Stationarity-in-an-Interrupted-time-series/m-p/873674#M4662
<P>I am using proc autoreg in SAS to conduct an ITS analysis and I have a question about stationarity. Proc autoreg is able to perform the augmented dickey-fuller (ADF), the phillips-person (PP), and the KPSS test for stationarity. I believe I have a good understanding of the difference in their interpretations.</P><P> </P><P>My question is whether I test for stationarity across the interruption. For example, if I had a 36 month study period with an interruption at month 25, would I look at stationarity as separate parts (months 1-24 and 25-36) or as a whole (1-36)? My thought process is, that the interruption would likely cause it not to be stationary and thus ran separately.</P><P> </P><P>Thank you for the clarification</P><P> </P><P>Code I am using below, but this seemed more of a statistical approach logic rather than a code question:</P><PRE><CODE>proc autoreg data=one;
model outcome = /stationarity=(kpss=(kernel=qs auto))stationarity=(phillips);
where 1<= month <= 24;
run;</CODE> </PRE><P> </P>Wed, 03 May 2023 15:33:22 GMThttps://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Stationarity-in-an-Interrupted-time-series/m-p/873674#M4662Levi_M2023-05-03T15:33:22ZRe: lasso logistic regression control variables
https://communities.sas.com/t5/Statistical-Procedures/lasso-logistic-regression-control-variables/m-p/856718#M42372
<P>thank you so much for your quick and informative response. </P>Wed, 01 Feb 2023 19:17:16 GMThttps://communities.sas.com/t5/Statistical-Procedures/lasso-logistic-regression-control-variables/m-p/856718#M42372Levi_M2023-02-01T19:17:16Zlasso logistic regression control variables
https://communities.sas.com/t5/Statistical-Procedures/lasso-logistic-regression-control-variables/m-p/856685#M42365
<P>I am conducting a logistic regression on variables that were selected via LASSO (hpgenselect). I have a question about my methodology.</P><P>(1) If I want to control for age and gender, do I exclude them from the lasso selection but include them in the logistic regression? Or do I include them in both the lasso and logistic regression?</P><P>(2) Is it appropriate to use hpgenselect and follow up with logistic regression </P><P>- Thank you - </P>Wed, 01 Feb 2023 16:55:05 GMThttps://communities.sas.com/t5/Statistical-Procedures/lasso-logistic-regression-control-variables/m-p/856685#M42365Levi_M2023-02-01T16:55:05ZRe: HPgenselect with a case control conditional logistic regression
https://communities.sas.com/t5/Statistical-Procedures/HPgenselect-with-a-case-control-conditional-logistic-regression/m-p/856466#M42340
<P>Thank you for the quick and informative response! While I am familiar with the model selection selection techniques in proc logistic, please correct me if I am wrong, these methods are primarily used for unconditional logistic regression and not applicable for conditional?</P><P>Thank you - </P>Tue, 31 Jan 2023 13:56:51 GMThttps://communities.sas.com/t5/Statistical-Procedures/HPgenselect-with-a-case-control-conditional-logistic-regression/m-p/856466#M42340Levi_M2023-01-31T13:56:51ZHPgenselect with a case control conditional logistic regression
https://communities.sas.com/t5/Statistical-Procedures/HPgenselect-with-a-case-control-conditional-logistic-regression/m-p/856246#M42331
<P>I have previously used glmselect and hpgenselect for linear and logistic regression model selection however I have come across a question. I am working on a case/control (1:3) conditional logistic regression with a high number of parameters and would like to perform dimensional reduction, like lasso. However, hpgenselect does not allow for the consideration of 'strata'. In this scenario, would it be inappropriate to consider hpgenselect because of the lack of 'strata', and, if so, are there alternatives in SAS that I am unaware of?</P><P> </P><P>Thank you - </P>Mon, 30 Jan 2023 14:39:11 GMThttps://communities.sas.com/t5/Statistical-Procedures/HPgenselect-with-a-case-control-conditional-logistic-regression/m-p/856246#M42331Levi_M2023-01-30T14:39:11ZMedian difference using MannU and quantile regression
https://communities.sas.com/t5/Statistical-Procedures/Median-difference-using-MannU-and-quantile-regression/m-p/848927#M42048
<P>Hi, I am looking to determine whether two medians are not equal and attempt to estimate the median difference between the two. From my research, I have found this can be done by performing the Wilcoxon Mann u test and quantile regression. However, I am confused on interrupting the for results each. Below if my data, code for both, results, and interpretation.<BR /><BR />I think I am in the right direction but: Having trouble with the median difference estimate interpretation as well as understanding why the discrepancy in significance results.<BR /><BR />Happy to clarify anything that may have been unclear and appreciate the support.<BR /><BR />Mann U (npar1way) median a median b median diff pval (kruskalW) hodgeL<BR />Interpretation 601 642 41 0.01 issue getting to load<BR />Median A and Median B are considered to be significantly different (difference=41, p<.05) as determined by the mannU test<BR />Quantile regression median a median b median diff pval<BR />Interpretation 601 642 34 (-74 - 143.78) 0.524<BR />Median A and Median B are not considered to be significantly different (difference= 34.5 (-74.7 - 143.78), p=.52) as determined by quantile regression</P><PRE><CODE class="">*Determine medians of the two groups;
proc means data=test_data median;
var y;
class x;
run;
*Perform W-Mann-U test using KW for results;
*HL for median difference not loading, useful?;
proc npar1way data=test wilcoxon median;
class x;
var y;
exact hl / maxtime=60;
run;
*Quantile regression to determine median difference estimate and signifiance difference;
proc quantreg data=test_data;
class x;
model y= x/ quantile=.5;
estimate x 1 -1 /CL;
run;</CODE></PRE><P> </P>Sat, 10 Dec 2022 19:41:17 GMThttps://communities.sas.com/t5/Statistical-Procedures/Median-difference-using-MannU-and-quantile-regression/m-p/848927#M42048Levi_M2022-12-10T19:41:17ZRe: Taking difference of Median for 2 different datasets
https://communities.sas.com/t5/SAS-Programming/Taking-difference-of-Median-for-2-different-datasets/m-p/848883#M335624
<P>Thank you for taking time to reply. I just posted a new question regrading this topic, with my data, code, and results. If you do have a chance, I would appreciate your thoughts. </P><P> </P><P><A href="https://communities.sas.com/t5/Statistical-Procedures/Quantile-Regression-and-MannU-test-for-median-difference/m-p/848882#M42043" target="_blank">https://communities.sas.com/t5/Statistical-Procedures/Quantile-Regression-and-MannU-test-for-median-difference/m-p/848882#M42043</A></P>Sat, 10 Dec 2022 12:37:16 GMThttps://communities.sas.com/t5/SAS-Programming/Taking-difference-of-Median-for-2-different-datasets/m-p/848883#M335624Levi_M2022-12-10T12:37:16ZRe: Taking difference of Median for 2 different datasets
https://communities.sas.com/t5/SAS-Programming/Taking-difference-of-Median-for-2-different-datasets/m-p/848825#M335583
<P>would you characterize proc quantreg as "median difference was determined by using quantile regression"? Would you expect to see similar significance values as mannU? Is there much a difference between the two?</P>Fri, 09 Dec 2022 22:02:25 GMThttps://communities.sas.com/t5/SAS-Programming/Taking-difference-of-Median-for-2-different-datasets/m-p/848825#M335583Levi_M2022-12-09T22:02:25ZRe: segmented regression delta/pvalue does not make sense?
https://communities.sas.com/t5/Statistical-Procedures/regression-pvalue-does-not-make-sense/m-p/830969#M41135
Makes sense, not sure why I did not realize this sooner!Mon, 29 Aug 2022 18:32:19 GMThttps://communities.sas.com/t5/Statistical-Procedures/regression-pvalue-does-not-make-sense/m-p/830969#M41135Levi_M2022-08-29T18:32:19Zregression pvalue does not make sense?
https://communities.sas.com/t5/Statistical-Procedures/regression-pvalue-does-not-make-sense/m-p/830949#M41133
<P>Hi, </P><P>I am comparing the trends of an interrupted segmented regression. I need some help understanding the relationship between my slope change and the p-value.</P><P> </P>Mon, 29 Aug 2022 19:08:23 GMThttps://communities.sas.com/t5/Statistical-Procedures/regression-pvalue-does-not-make-sense/m-p/830949#M41133Levi_M2022-08-29T19:08:23ZRe: ARIMA model to proc ARIMA
https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/ARIMA-model-to-proc-ARIMA/m-p/830946#M4498
<P>Thank you for your feedback. Unfortunately, I do not know R very well either and a package was using fit parameters ie AIC to determine the model without providing much context. However, the resources you provide helped me continue working on my project. </P><P>Thank you. </P>Mon, 29 Aug 2022 17:04:12 GMThttps://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/ARIMA-model-to-proc-ARIMA/m-p/830946#M4498Levi_M2022-08-29T17:04:12ZARIMA model to proc ARIMA
https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/ARIMA-model-to-proc-ARIMA/m-p/829223#M4480
<P>Hi, </P><P>I am working on an intervention/ITS analysis. I first ran the analysis in R and would like to marginally replicate my results in SAS but I am having trouble. Given my ARIMA model from R and current proc arima code, I was hoping that you could point me in the right direction as the results do not make sense.</P><P> </P><P>R model ARIMA=(3,0,0)</P><P>proc arima data=one;</P><P> identify=y cross=(step ramp);</P><P> estimate p=3 input=(step ramp) method=ml outmodel=out; </P><P>run;</P><DIV class=""> </DIV><P><U>results</U></P><P>SAS</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="unnadamed.png" style="width: 400px;"><img src="https://communities.sas.com/t5/image/serverpage/image-id/74518iF25B3F07F8BBB9FE/image-size/medium?v=v2&px=400" role="button" title="unnadamed.png" alt="unnadamed.png" /></span></P><P> R</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="unnamed.png" style="width: 400px;"><img src="https://communities.sas.com/t5/image/serverpage/image-id/74519i6EAB9D35C224EB84/image-size/medium?v=v2&px=400" role="button" title="unnamed.png" alt="unnamed.png" /></span></P><P> </P><P>Thank you!</P><P> </P><P> </P>Thu, 18 Aug 2022 14:58:13 GMThttps://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/ARIMA-model-to-proc-ARIMA/m-p/829223#M4480Levi_M2022-08-18T14:58:13ZARIMA model to proc autoreg
https://communities.sas.com/t5/Statistical-Procedures/ARIMA-model-to-proc-autoreg/m-p/828876#M41035
<P>Hi, </P><P>I have a few ARIMA models (R) show below and I was looking to duplicate them using PROC AUTOREG and GARCH, however, I have not been able to replicate them to were they are relatively similar. I was hoping to see if it was possible and how it would fit into the proc autoreg statement.</P><P>Models:</P><P>ARIMA(0,0,0)<BR />ARIMA(4,0,0)<BR />ARIMA(0,0,2)<BR />ARIMA(1,0,0)(1,0,0)[12]</P><P> </P><P>Thank you,</P>Tue, 16 Aug 2022 17:43:55 GMThttps://communities.sas.com/t5/Statistical-Procedures/ARIMA-model-to-proc-autoreg/m-p/828876#M41035Levi_M2022-08-16T17:43:55ZRe: Interrupted time series with proc autoreg
https://communities.sas.com/t5/Statistical-Procedures/Interrupted-time-series-with-proc-autoreg/m-p/828668#M41021
<P>Hi Koen,</P><P>I wanted to revisit your answer with a question:</P><P>You mention not using the effect "time_aft_int" in ITS, however, you list it under schemas to "allow for trend changes" and I see it is also reference in the "PROC MODEL" solution paper. </P><P>Could you clarify why you would not use it but it is included in references?</P><P> </P><P>Thank you!</P><P> </P><P> </P>Mon, 15 Aug 2022 12:33:50 GMThttps://communities.sas.com/t5/Statistical-Procedures/Interrupted-time-series-with-proc-autoreg/m-p/828668#M41021Levi_M2022-08-15T12:33:50ZRe: How to conduct interrupted time series regression in SAS?
https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/How-to-conduct-interrupted-time-series-regression-in-SAS/m-p/828626#M4479
Proc autoreg might be what you are looking forSun, 14 Aug 2022 20:24:14 GMThttps://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/How-to-conduct-interrupted-time-series-regression-in-SAS/m-p/828626#M4479Levi_M2022-08-14T20:24:14ZRe: Segmented line graph
https://communities.sas.com/t5/SAS-Programming/Segmented-line-graph/m-p/825481#M326063
<P>I see what you are saying, thanks. I just need to drop that boundary region. </P><P> </P><P>Thanks.</P>Tue, 26 Jul 2022 17:36:32 GMThttps://communities.sas.com/t5/SAS-Programming/Segmented-line-graph/m-p/825481#M326063Levi_M2022-07-26T17:36:32ZRe: Segmented line graph
https://communities.sas.com/t5/SAS-Programming/Segmented-line-graph/m-p/825479#M326061
<P>Thank you for your reply. What I meant to say was the two regression lines. </P><P> </P><P>EDIT: for example, when I run this same process in R, the two regression lines meet at the joint. (with the same results)</P>Tue, 26 Jul 2022 17:29:17 GMThttps://communities.sas.com/t5/SAS-Programming/Segmented-line-graph/m-p/825479#M326061Levi_M2022-07-26T17:29:17ZSegmented line graph
https://communities.sas.com/t5/SAS-Programming/Segmented-line-graph/m-p/825476#M326059
<P>Hi! I am putting together a segmented regression with visualization. However, plotting the data, I can not seem to get the two periods to touch. Could anyone help provide assistance with this?</P><P> </P><P><STRONG><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="unnamed.png" style="width: 674px;"><img src="https://communities.sas.com/t5/image/serverpage/image-id/73744i1A374E0533065978/image-size/large?v=v2&px=999" role="button" title="unnamed.png" alt="unnamed.png" /></span>proc</STRONG><SPAN> </SPAN><STRONG>autoreg</STRONG><SPAN> </SPAN>data=a1; </P><P> <SPAN> </SPAN>model<SPAN> </SPAN>rates = QTRs aft_cnt /<SPAN> </SPAN>method=ml<SPAN> </SPAN>nlag=<STRONG>12</STRONG><SPAN> </SPAN>backstep<SPAN> </SPAN>dwprob<SPAN> </SPAN>loglikl;;</P><P> <SPAN> </SPAN>output<SPAN> </SPAN>out=auto_reg<SPAN> </SPAN>predicted=pred;</P><P> <SPAN> </SPAN>by<SPAN> </SPAN>Patient_Age_Category; <SPAN> </SPAN>/*This line of code will treat each age_cat separately*/</P><P><STRONG>quit</STRONG>;</P><P> </P><P><STRONG>proc</STRONG><SPAN> </SPAN><STRONG>sgplot</STRONG><SPAN> </SPAN>data=glimmix_out<SPAN> </SPAN>noautolegend;</P><P> <SPAN> </SPAN>block<SPAN> </SPAN>x=QTRs<SPAN> </SPAN>block=period /<SPAN> </SPAN>transparency=<STRONG>.75</STRONG>;</P><P> <SPAN> </SPAN>scatter<SPAN> </SPAN>x=QTRs<SPAN> </SPAN>y=rates /<SPAN> </SPAN>markerattrs=(symbol=CircleFilled<SPAN> </SPAN>color=black);</P><P> <SPAN> </SPAN>series<SPAN> </SPAN>x=QTRs<SPAN> </SPAN>y=pred /<SPAN> </SPAN>group=period<SPAN> </SPAN>lineattrs=(thickness=<STRONG>3</STRONG>);</P><P> <SPAN> </SPAN>by<SPAN> </SPAN>Patient_Age_Category; <SPAN> </SPAN>/*This line of code will treat each age_cat separately*/</P><P><STRONG>run</STRONG>;</P><P> </P><P> </P><P>Thank you!!</P>Tue, 26 Jul 2022 17:15:11 GMThttps://communities.sas.com/t5/SAS-Programming/Segmented-line-graph/m-p/825476#M326059Levi_M2022-07-26T17:15:11Zobtaining an odds ratio using proc autoreg
https://communities.sas.com/t5/Statistical-Procedures/obtaining-an-odds-ratio-using-proc-autoreg/m-p/823542#M40803
<P>I am using proc autoreg to model an interrupted time series with fixed effects. I understand the usual output, immediate and slope change. My question is, is there some code that I can enter to have proc autoreg compute the odds ratio? I know this is possible with proc glimmix. Thanks.</P>Fri, 15 Jul 2022 16:07:16 GMThttps://communities.sas.com/t5/Statistical-Procedures/obtaining-an-odds-ratio-using-proc-autoreg/m-p/823542#M40803Levi_M2022-07-15T16:07:16ZRe: RanMBIN macro
https://communities.sas.com/t5/SAS-Programming/RanMBIN-macro/m-p/820935#M324071
<P>Thank you for the feed back. I have attached the 4 items that I am using for the dataset generation. </P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="spaxxs_0-1656514950095.png" style="width: 400px;"><img src="https://communities.sas.com/t5/image/serverpage/image-id/72816i42DDF2DC0C823A43/image-size/medium?v=v2&px=400" role="button" title="spaxxs_0-1656514950095.png" alt="spaxxs_0-1656514950095.png" /></span></P><P> </P><P>Hopefully this helps?</P>Wed, 29 Jun 2022 15:05:23 GMThttps://communities.sas.com/t5/SAS-Programming/RanMBIN-macro/m-p/820935#M324071Levi_M2022-06-29T15:05:23Z