Announcement

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

  • Problem with merging my datasets on stata- panel data

    Hi,

    I have a 7-year dataset, I want to merge all together into one single dataset using the id and survey-year but it is not merging at all.

    Please, what can I do to make it work?

    I used this code,

    use "C:\Users\stuart\Desktop\THESIS DATA 1ST JULY\sort\stata data\2010...dta"

    . clear

    . import delimited "C:\Users\stuart\Desktop\THESIS DATA 1ST JULY\sort\CSV DATA\2011
    > sorted.csv"
    (13 vars, 1,414 obs)

    . merge 1:1 id suryear using "C:\Users\stuart\Desktop\THESIS DATA 1ST JULY\sort\sta
    > ta data\2010...dta"

    Result # of obs.
    -----------------------------------------
    not matched 2,835
    from master 1,414 (_merge==1)
    from using 1,421 (_merge==2)

    matched 0 (_merge==3)
    -----------------------------------------

    Secondly, is it compulsory to always use the merge code for panel data or can I use the append code as well?

    Lastly, in analysing the impact of nationality on the wage gap, is it compulsory to have a balanced panel data or not because some individuals were not observed in all the 7years of the survey

    Thanks

  • #2
    At https://www.statalist.org/forums/for...-data-analysis, the original poster was recommended to use -append- instead of -merge-.
    As an aside, using commands aimed at combining datasets, such as -append- and -merge-, is usually not conditional on the type of subsequent statistical analysis to be performed.
    Kind regards,
    Carlo
    (Stata 18.0 SE)

    Comment

    Working...
    X