Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7749977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:10:17+00:00 2026-06-01T11:10:17+00:00

I have spent much time looking for a special package that could run the

  • 0

I have spent much time looking for a special package that could run the Pesaran(2007) unit root test (which assumes cross-sectional dependence unlike most others) and I have found none. So, I decided to do it manually; however, I don’t know where I’m going wrong, because my results are very different from Microsoft Excel’s results (in which it is done very easily).

My data frame is made up of 22 countries with 506 observations of daily price indices. Following is the model to run using the Pesaran(2007) unit root test:

(i) With an intercept only

enter image description here

where $\overline{Y}$ is the cross-section average of the observations across countries at each time $t$ and $b$ is the coefficient of interest to us because it will allow us to compute the ADF test statistic and then determine whether the process is stationary or not.

I constructed each of these variables in the following way:

(Delta)Y(t)

dif.yt = diff(yt) 
## yt is the object containing all the observations for a specific country 
## (e.g. Australia)

Y(t-1)

yt.lag.1 = lag(yt, -1)

Y(bar)(t-1)

ybar.lag.1 = lag(c(rowMeans(x)), -1) 
## x is the object containing my entire data frame

(Delta)Y(bar)(t-1)

dif.ybar.lag.1 = diff(ybar.lag.1)

(Delta)Y(bar)(t-2)

dif.ybar.lag.2 = diff(lag(c(rowMeans(x)), -2))

(Delta)Y(t-1)

dif.yt.lag.1 = diff(yt.lag.1)

(Delta)Y(t-2)

dif.yt.lag.2 = diff(lag(yt, -2)

After constructing each variable individually, I then run the linear regression

reg = lm(dif.yt ~ yt.lag.1[-1] + ybar.lag.1[-1] + dif.ybar.lag.1 + 
                  dif.ybar.lag.2 + dif.yt.lag.1 + dif.yt.lag.2)
summary(reg)

It is obvious that the explanatory variables in my regression equation differ in length, so I’d like to know whether there is a way in R to make all the variables of equal length (perhaps with a function).

Also, I’d like to know whether the procedure I used was correct and if there are more optimal ways.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T11:10:18+00:00Added an answer on June 1, 2026 at 11:10 am
     library(dynlm)
    
        #object class is a zoo or ts 
    
      reg =   dynlm(d(yt) ~ (L(yt, 1) + L(ybar,1) + d(L(ybar,1) + ....
         data = ~yourdata, start = .... other args)
    
    summary(reg)
    

    More details about the package: http://cran.r-project.org/web/packages/dynlm/dynlm.pdf

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have spent way too much time looking for the files owner icon to
I have spent too much time on this problem and am beginning to think
Ok ill be honest, i haven't spent much time looking for a solution yet
I have spent lot of time doing research on VIM. I am Windows guy
I have spent some time now to solve a problem for which i have
We have a database that contains information about time booked to projects. We have
I've spent a lot of time working in Django, and have grokked the framework
I have been looking into recursion and TCO. It seems that TCO can make
I have spent a lot of time getting into iOS development. I have spent
I have spent several hours trying to find a means of writing a cross

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.