I am interested in comparing a linear trend model with 1) power trend, 2) exponential trend, and 3) logarithmic trend models - comparing models using estimated AIC and BIC to identify the one that best fits my data.
I had a play with a sample dataset and wanted to make sure my models are well specified - grateful for any comment/suggestion for improvement:
clear
use http://www.stata-press.com/data/r16/friedman2.dta
* Create a time variable - rather than using the existing one (yearquarter)
g timen = _n
* Log variables
g ln_consum = log(consump)
g ln_time = log(timen)
* Linear trend model
regress consum timen
estat ic
* Exponential trend model
regress ln_consum timen
estat ic
* Power trend model
regress ln_consum ln_time
estat ic
* Logarithmic trend model
regress consum ln_time
estat ic
Related Posts with Trend analysis
combining histograms of different bin sizes and plotting gamma distribution on themHi all I have prepared histograms (attached) of % trip by trip lengths in the UK for two modes of t…
Creating categorical variables with multiple different conditions from continuous variablesHi, I am trying to create a categorical variable of "activity". I want 0=<150 mins of activity. …
(Generalized) Ordered Logit marginal effectsDear Statalist, I'm having trouble to derive marginal effects after computing a Generalized Ordered…
help Generalized linear models family gamma log linkThis is my first go round with glm. As my variable distribution appaered positively skewed, i fitted…
Using and interpreting multi level mixed effects logictic regression with nested clusteringI have a dataset with around 30,000 participants, clustered into 20,000 families which are further c…
Subscribe to:
Post Comments (Atom)
0 Response to Trend analysis
Post a Comment