zahra posted on Thursday, January 09, 2020 - 7:53 am
Thanks. I read articles and can write this program.I have two questions.1)Is this correct?(I have the number of new case of a disease for some cities from 1990 to 2017)2)how can i use of FScore to forecast new case? DATA: file is "H:/africa2.dat"; ! Calling data; VARIABLE: NAMES = id time y; CLUSTER = id; ! Specify the person id variable USEVAR = y; ! Specify which variables are used in the model MISSING = ALL(-999); LAGGED = y(1); ! This creates lagged variables !TINTERVAL = sessdate(1); ! This is to account for unequal intervals ANALYSIS: TYPE = TWOLEVEL RANDOM; ! This allows for random slopes ESTIMATOR = BAYES; ! DSEM requires Bayesian estimation PROC = 2; ! Using 2 processors makes it faster BITER = (5000); ! This implies at least 5000 iterations are used THIN = 10; ! Thinning helps with getting more stable results MODEL: %WITHIN% ! Specify the random lagged relationships p | y ON y&1; %BETWEEN% ! p WITH y OUTPUT: TECH1 TECH8 STDYX; PLOT: TYPE = PLOT3; FACTORS = ALL; SAVEDATA: FILE = 1.dat; SAVE = FSCORES (100);
For a particular city/cluster you can get the median estimates for YB (Y on the between level) and P from the 1.dat file.
Since Y=YW+YB and since YB doesn't change across time, getting predictions for Y is the same as getting predictions for YW and adding the estimate of YB.
Since YW(t)=p*YW(t-1)+e, the predicted value for YW(2018) is p*YW(2017)=p*(Y(2017)-YB). The predicted value for YW(2019) is p*p*(Y(2017)-YB). The predicted value for YW(2020) is P^3*(Y(2017)-YB) etc. The predicted value YW(t) for a very distant year t (such as t=2050) will be 0 as P<1 and thus the predicted value for Y(t) will be simply YB.
Because of the context, however, the above model doesn't account for population increase and it would not be a good model. You have two options
1. Model "the number of new case of a disease per 10000 people" instead of the absolute value. This number would be not as dependent of the population increase.
2. You can incorporate the population increase in the model with RDSEM %within% Y on t; p | Y^ on Y^1; That model will have a different prediction scheme: beta*t + predicted value for YW + YB
Zahra posted on Tuesday, January 28, 2020 - 7:00 am
Thank you. In our analysis p is 1 or near 1 and so we saw a jump in our prediction.why it happen?and how we can solve it? thanks
It probably happens because the trend isn't modeled correctly. See point 2 in my previous answer.
Zahra posted on Sunday, February 02, 2020 - 1:05 am
We run point 2 within model but our p is still near 1.what should I do? Thanks
Zahra posted on Sunday, February 02, 2020 - 10:07 am
I also have question about this warning which happen in all of 53 cluster.Is it important? "WARNING: PROBLEMS OCCURRED IN SEVERAL ITERATIONS IN THE COMPUTATION OF THE STANDARDIZED ESTIMATES FOR SEVERAL CLUSTERS. THIS IS MOST LIKELY DUE TO AR COEFFICIENTS GREATER THAN 1 OR PARAMETERS GIVING NON-STATIONARY MODELS. SUCH POSTERIOR DRAWS ARE REMOVED. THE FOLLOWING CLUSTERS HAD SUCH PROBLEMS: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53"