Announcement

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

  • Using csipolate to interpolate panel data

    Hi there,

    I'm very new to Stata (only a few days), statistics and programming in general so do bear with me if I ask any silly questions or describe things clumsily.

    I'm trying to use a cubic spline to interpolate monthly GDP per capita data from yearly GDP per capita for a panel dataset (160 countries and 193 time points) for an undergraduate Sociology project. I understand that it is a bit of a stretch to interpolate 11 data points from 2, and so would refine the method if given the chance, but due to time constraints I have to make do with this method for now.

    Previous forum comments suggest using the -csipolate- but I am unable to install the package as I am using a shared computer and do not have permission to update the ado folder. Any suggestions of how I may be able to bypass this?

    Meanwhile, I am testing the code with -ipolate- for the moment but am getting strange results. The new variable does not copy over the exising data points in the old variable and the new data points are all recorded as unitary. My code is as follows:
    xtset cname1 date2
    bysort cname1: ipolate gdpc1 date2, g(gdpc_ipo)

    A screenshot of my data editor:
    Click image for larger version

Name:	pic1.jpg
Views:	1
Size:	127.0 KB
ID:	1383887


    Would greatly appreciate any help. Thank you!

  • #2
    Welcome to Statalist, Sylvia.

    You've accidentally posted your question in the Mata forum, which is devoted to questions about Mata, a very focused portion of Stata. Your question will have more visibility if you post it in the General forum, since it has nothing to do with Mata.

    With that said, please review the Statalist FAQ linked to from the top of the page, as well as from the Advice on Posting link on the page you used to create your post, looking especially at sections 9-12 on how to best pose your question. It would be particularly helpful to post a small hand-made example, perhaps with just a few variables and observations, showing the data before the process and how you expect it to look after the process. In particular, please read FAQ #12 and use dataex and CODE delimiters when posting to Statalist.

    You will see that the advice is very specific about not posting pictures of your data. At a minimum, anyone who wants to reproduce your results is unable to do so, because Stata cannot read pictures of data, and "I want to retype 26 lines of data from a screenshot" was said by nobody ever.

    And with that said, I think your commands need to be
    Code:
    xtset cname1 date2 
    bysort cname1 (date2): ipolate gdpc1 date2, g(gdpc_ipo)
    but as noted, I cannot confirm this from your sample data.

    Comment

    Working...
    X