Dear All,
I would really be grateful if you could help me with this as I have spent more than a month figuring out the correct way to do this but still am confused.
I’m looking at the trends in the individual comorbidities, death, length of stay of a particular diagnosis over the years.
I found out that the trends in proportions of comorbidities over years is by “ptrend”. But the way the data should be entered is very specific for this command. The problem is I can’t manually enter the data that is in millions. So I try to do it in 2 following ways: For example, for CAD comorbidity: I calculate individual proportion of CAD each year (n1) and then remaining (100-n1) would be n2 and then put this data in a separate excel to be analyzed by STATA for trend over the years by command “ptrend n1 n2 Year”. Other way is- I create a dummy variable of “n2=1 if n1==0” in the existing data and again ran the analysis with the command “ptrend n1 n2 Year”. The problem is, I’m getting a different P value but these methods. So I’m not sure if I’m doing either of them correctly or not.
One of my colleagues said “nptrend” and also be used to assess the trends of categorical variable over the years. But my understanding was in “nptrend” is for looking at the trends in the continuous variables only (for example, length of stay in days). Is that correct?
Plus, my understanding is I have to expand the weight variable before running either of these commands. Is that correct?
I have read all the blogs and online questions available on this topic of trend analysis in STATA but everything lead to so much confusion. I just want to use the “ptrend” and the “nptrend” commands correctly in order to get the correct p values of trends. In summary, can I just use the “nptrend” or “vwls” command for both categorical (0/1) variables and continuous variables, after expanding the weights? Please guide.
Related Posts with Determining the P value for trends of continuous and categorical variables over the years.
Estimating FE model with -reg or -xtregDear, I am estimating a panel data fixed effects model (both year and industry). I am aware I can e…
Validity of a model for a data set using prediction.Hi I have a question whether we can assess the validity of a model for a data set using prediction. …
Problem: no observations r(2000)Hello i'm making a dynamic panel and i want to estimate a model with pmg, mg and dfe. When I do th…
Propensity Score Matching: How to run analysis using a certain block?Hello, I believe this is a very newbie question but would be greatly appreciated if anyone can help …
adding summary weight in metabolic scoreHi, I am trying to generate a metabolic syndrome score for the children aged 11 to 12 years using PC…
Subscribe to:
Post Comments (Atom)
0 Response to Determining the P value for trends of continuous and categorical variables over the years.
Post a Comment