Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Transforming Time Series Data

    I have a Time Series on the price of coffee and 450 observations. Is there any particular reason I see articles log transforming the data?

    Thanks in advance

  • #2
    There are several reasons one might log-transform a variable. Usually, in a published article, the authors will say why they have done it. But, the common reasons are:

    1. They want the variable to have a closer to normal distribution. Note that this is often based on a misunderstanding of the role of normal distributions in data analysis. When they say this, I'd guess that most of the time it was unnecessary.

    2. The variable in question ranges over several orders of magnitude, and this makes graphical analyses difficult. A log-transformation overcomes this.

    3. The investigators are more interested in multiplicative changes in the variable than the additive ones that are typically calculated in regression models. An additive change in log x corresponds to a multiplicative change in x.

    4. Theory, or previous exploratory analyses, suggests that the relationship being studied between x and some other variable y, takes on a simpler form when expressed in terms of log x than x. For example if the form of the relationship is, say, y = x^3, then log y = 3 log x. So a linear regression of log y on log x is a better-specified model than regressing y on x.

    I know nothing about coffee prices, and you don't tell us anything about what kinds of analyses you are contemplating, so I can't advise which, if any, of these reasons might apply in your situation.

    Comment


    • #3
      Matthew:
      welcome to the list.
      In economics, one reason for logging the dependent variable in a so-called log-linear model is in line with Clyde's #3.
      If both dependent (Y) and independent (X) variables (let's assume the most trivial case of a simple OLS) are logged, a so-called log-log regression model comes alive; in that case, the researcher's goal is to calculate the elasticity of Y with respect to X (which is captured by beta1 coefficient).
      I can't say if what above fits to your research task, though.
      Kind regards,
      Carlo
      (Stata 19.0)

      Comment


      • #4
        Dear all,

        Thanks for taking the time out to reply to my question, very helpful, my data is on the new york cash price of coffee, it is a simple project that we working on estimating the model, checking for stationarity and utilizing all the unit root tests etc. to confirm stationarity. All this is just to confirm our understanding of basic time series, if i may ask, are there any tests for stationarity before estimating for example an AR(2) model?

        Comment


        • #5
          Matthew:
          unfortunately I'm not familiar with time series analysis.
          Kind regards,
          Carlo
          (Stata 19.0)

          Comment


          • #6
            Dear Matthew,

            If you want to test stationarity of a time series dataset, you should use Dickey Fuller test
            Code:
            dfuller variable, trend
            and if your time series dataset is non-stationary, you should difference it by typing
            Code:
            D.variable
            All time series analysis should transform data to stationary before using ACF and PACF for choosing models. Using -pergram- command for discovering seasonality of your time series.
            Code:
            pergram sxh_m, graph
            if you would like to find out whether your time series has a break during the period observed, you should use the code
            Code:
            zandrews variable,break(trend) graph
            I also give you a link to a useful website for time series analysis
            https://onlinecourses.science.psu.edu/stat510/
            Hope it helps!
            Last edited by Thong Nguyen; 07 Mar 2017, 18:03.

            Comment


            • #7
              Dear Matthew,
              I give you a link to a useful website on time series analysis, in which it contains information about why researchers should transform data in order to stationarize the orginal non-stationary data.
              https://www.analyticsvidhya.com/blog...-codes-python/
              Hope it helps!

              Comment


              • #8
                Hi all,

                Thank you very much, all this information was very useful and I managed to complete my assignment.

                King Regards,
                Matt

                Comment

                Working...
                X