05-13-2019
medic
Fluorite | Level 6
Member since
08-02-2017
- 7 Posts
- 3 Likes Given
- 0 Solutions
- 0 Likes Received
-
Latest posts by medic
Subject Views Posted 1048 05-10-2019 03:01 AM 935 04-10-2019 08:03 AM 994 04-09-2019 05:31 AM 1715 04-04-2019 12:49 AM 1741 04-03-2019 09:59 PM 2044 04-09-2018 01:50 PM 2054 04-09-2018 01:45 PM -
Activity Feed for medic
- Posted estimating coefficients from Interrupted time series using ARIMA in PROC ARIMA on SAS Forecasting and Econometrics. 05-10-2019 03:01 AM
- Posted Re: why is the result of (start, end) different from calculated result in PHREG? on Statistical Procedures. 04-10-2019 08:03 AM
- Posted why is the result of (start, end) different from calculated result in PHREG? on Statistical Procedures. 04-09-2019 05:31 AM
- Tagged why is the result of (start, end) different from calculated result in PHREG? on Statistical Procedures. 04-09-2019 05:31 AM
- Tagged why is the result of (start, end) different from calculated result in PHREG? on Statistical Procedures. 04-09-2019 05:31 AM
- Tagged why is the result of (start, end) different from calculated result in PHREG? on Statistical Procedures. 04-09-2019 05:31 AM
- Liked Re: Is there a way to plot loglogs (LLS) graph with very large data in SAS? for Tom. 04-09-2019 05:18 AM
- Liked Re: Is there a way to plot loglogs (LLS) graph with very large data in SAS? for PeterClemmensen. 04-04-2019 03:22 AM
- Posted Re: Is there a way to plot loglogs (LLS) graph with very large data in SAS? on SAS Programming. 04-04-2019 12:49 AM
- Posted Is there a way to plot loglogs (LLS) graph with very large data in SAS? on SAS Programming. 04-03-2019 09:59 PM
- Tagged Is there a way to plot loglogs (LLS) graph with very large data in SAS? on SAS Programming. 04-03-2019 09:59 PM
- Tagged Is there a way to plot loglogs (LLS) graph with very large data in SAS? on SAS Programming. 04-03-2019 09:59 PM
- Tagged Is there a way to plot loglogs (LLS) graph with very large data in SAS? on SAS Programming. 04-03-2019 09:59 PM
- Liked Re: import multiple text files with missing values for Reeza. 04-09-2018 01:54 PM
- Posted Re: import multiple text files with missing values on SAS Programming. 04-09-2018 01:50 PM
- Posted import multiple text files with missing values on SAS Programming. 04-09-2018 01:45 PM
-
Posts I Liked
Subject Likes Author Latest Post 1 1 1
05-10-2019
03:01 AM
Hi SAS experts, I'm trying to do an interrupted time series (ITS) analysis to compare before and after certain intervention. (Ref. https://academic.oup.com/ije/article/46/1/348/2622842) From the reference, here are the steps I went through so far. 1.I prepared the dataset with variables (1) outcome (2) t_before [serial count 1,2,3...] (3) intervention [0 or 1] (4) t_after [0,0,0,...intervention... , 1, 2, 3...] 2. Then I used PROC ARIMA identify to check for the stationarity as follows: proc arima data=sample;
identify var=outcome stationarity=(adf);
run; since the result showed that 'outcome' is nonstationary, I used first-order difference as follows and the test showed stationary: proc arima data=sample;
identify var=outcome(1) stationarity=(adf);
run; 3. and from the ACF, PACF plots from above, I thought AR(5) model would fit, so I tried final diagnosis as: proc arima data=sample;
identify var=outcome(1) ;
run;
estimate p=5;
run; and the result seemed reasonable. So, here is my question. 0. the ITS equation I want to use is : outcome = t_before(b1 -> previous trend) intervention(b2 -> level change) t_after(b3 -> trend change) , under ARIMA (5, 1, 0) model 1. if so, how can I put this equation into PROC ARIMA to get the coefficients of b1, b2, and b3? some references seem to use PROC MODEL, or PROC AUTOREG, but I don't think those cases consider the ARIMA (because those programs have no coded lines such as 'p=~~', 'q=~~' or checking ACF, PACF and so on) 2. if I also want to estimate the slope of post trend, which is (b1+b3), how should I code to get the estimation and the p-value for (b1+b3) I attached the sample dataset. Thanks for your help in advance
... View more
04-10-2019
08:03 AM
Thanks. Here are some examples of my data structure. Say the study period is until 2013-12-31 as in ID 1. But if there's a change in any subject due to some time-dependent variable (treatment / as in ID 2 and 3), I updated the attribute before and after the date of the change as in Table 1. Table 1. ID startdate1 enddate1 treatment1 outcome1 startdate2 enddate2 treatment1 outcome2 1 2013-05-01 2013-12-31 0 0 . . . . 2 2013-06-01 2013-06-30 0 0 2013-06-30 2013-11-20 1 0 3 2013-07-01 2013-07-30 0 0 2013-07-30 2013-12-01 1 1 In order to run this through PROC PHREG, I changed the dataset into long form as following table 2. (i.e, those who have different states have 2 rows) Table 2. ID start end treatment outcome 1 2013-05-01 2013-12-31 0 0 2 2013-06-01 2013-06-30 0 0 2 2013-06-30 2013-11-20 1 0 3 2013-07-01 2013-07-30 0 0 3 2013-07-30 2013-12-01 0 1 and the code goes as: proc phreg data=sample; class treatment (ref='0'); model (start, end)*outcome(0) = treatment / rl; strata OOO (some other adjusting variables); run; But when I run this code, it takes several hours to get the results. (original dataset has about 10 million records) So instead using (start, end) form, I manually calculated the time-to-event (tte) as following table 3 Table 3. ID tte treatment outcome 1 244 0 0 2 29 0 0 2 143 1 0 3 29 0 0 3 124 0 1 and only changed the (start, end) part into "tte" as : proc phreg data=sample; class treatment (ref='0'); model tte*outcome(0) = treatment / rl; strata OOO (some other adjusting variables); run; In this case, the program only takes minutes, but the results are different from when using (start, end) statement. (sorry that I don't have exact numbers since I'm running another program right now) * I referred to http://support.sas.com/resources/papers/proceedings12/168-2012.pdf this article when managing the dataset, though it doesn't say anything about whether manually calculating the time-to-event will result the same or not. hope this explains enough to ask for your help.
... View more
04-09-2019
05:31 AM
Hi, I'm using a PROC PHREG to manage survival data. Since explain variable is time-dependent, I coded as: (start, end)*censor(0)=variable I also made another dataset by manually calculating the time to event period (tte = end - start) because the original code takes too long to process, and ran the following code: tte*censor(0)=variable But the results from those two codes are different, although I think the only difference is that I already calculated the result of "(start, end)". Can anyone explain why this is happening? Thanks a lot in advance!
... View more
04-04-2019
12:49 AM
that seems reasonable. Thanks. Could you help a little more about how I can get the results as a dataset?
... View more
04-03-2019
09:59 PM
Hello, I'm trying to plot a loglog vs log graph using PROC LIFETEST in SAS, so that I can check the proportional hazard assumption with the data. However, since I'm dealing with a very large data (appx. 7-million records) the system stops running with the error saying: ERROR: JVM(Java virtual machine) exception. java.lang.OutOfMemoryError: Java heap space. After with some searching, I increased the memory capacity from 128m to 1024m but the problem remains same. Would there be any better options to plot the graph? or is there any other way (that my computer can handle) to check the proportional hazard assumption? Thanks in advance ods graphics on; proc lifetest data=data plot=(lls) notable; time tte*outcome(0); strata treatment; run;
... View more
04-09-2018
01:50 PM
wow... Thank you sooooo much. It works now!! I was struggling with this whole day T.T Thanks a lot!!
... View more
04-09-2018
01:45 PM
Hi all, I'm trying to import multiple text files with comma(,) as delimiter, and make it as one dataset. I refered to the following post and wrote a program as follows: https://communities.sas.com/t5/General-SAS-Programming/read-in-multiple-txt-files-in-to-one-SAS-file/td-p/86690 my program: filename file pipe 'dir D:\test\*.txt /s /b';
data test.t200_test;
infile file truncover;
input fname $100.;
infile in filevar=fname end=last truncover dlm=',' firstobs=1;
do until(last);
input A $ B $ C $ D $;
output;
end;
run; the problem I'm struggling is that in the data file, there are some missing values such as 123, A01, 20180401, 54321 234, , 20180401, 23412 ( <- missing data in the second column ) 345, D31, 20180402, 12345 in this case, the dataset from the code above looks like A B C D 123 A01 20180401 54321 234 20180401 23412 345 D31 20180402 12345 which means, the program does not recognize that there's a missing value in second row of the column B, and just enters the value which is supposed to be in column C, and eventually leaving the last column empty. But if there's no missing value on the next row, then the data is entered correctly again. However, if I don't use this program and manually import the data files one by one using proc import procedure or import wizard, then there's no problem like this and becomes as what it should look like : A B C D 123 A01 20180401 54321 234 . 20180401 23412 345 D31 20180402 12345 Thank you in advance for your help!
... View more