Hi,
I have one dataset with 33 observations where I have three geographical variables:
state which is the largest one,
region- the second largest
district - the smallest union,
e.g the dataset looks like this:
state )region district
Arunachal Pradesh. Arunachal East East Slag
Arunachal Pradesh Arunachal East lohit
Arunachal Pradesh Arunachal East trap
Arunachal Pradesh Arunachal West East Kameng
Arunachal Pradesh Arunachal West Lower Subansiri
The second dataset, individual level, I have 321 observations, with the name of the people coming from each state and regions, say. The same name is very rarely happening more than once in the second data, e.g means it is not very often found in more than one region.
state region
Arunachal Pradesh. Arunachal East KASHME LINGI
Arunachal Pradesh Arunachal East. WANGCHA RAJKUMAR
Arunachal Pradesh Arunachal West PREM KHANDU THUNGON
What I want to have is for each of the name that is present in the second dataset to be matched to each of the districts from the first data, irrespective if that name appears for all regions in the second data or not e.g. the name KASHME LINGI appears in Arunachal Pradesh. state and Arunachal East region , but I want it to be matched to all the districts of the state Arunachal Pradesh, so I want my data to look like this
state )region district name
Arunachal Pradesh. Arunachal East East Slag KASHME LINGI
Arunachal Pradesh Arunachal East lohit KASHME LINGI
Arunachal Pradesh Arunachal East trap KASHME LINGI
Arunachal Pradesh Arunachal West East Kameng KASHME LINGI
Arunachal Pradesh Arunachal West Lower Subansiri KASHME LINGI
Similarly, for the rest of the names. Merge command , doesn't work. Can you please let. me know how to proceed?
Many thanks,
Ciara
Related Posts with Matching two datasets
Panel DataHello I am making a panel data model where I have the following regression: xtreg Domestic_Health rD…
Does lowess take a long time?I am running Stata SE/17.0 on a Windows machine with Intel i7 1.8GHz, and 32GB RAM. So not exactly t…
Count distinct values by groupsHello everyone, I have one question related to counting distinct values by groups. Here is an examp…
Creation of Compound Interest variableGood evening everyone, I do have the closing prices NAV (net asset value) and I calculate the retur…
Comparing cox proportional hazard linear and non-linear (restricted cubic spline) models using likelihood ratio testHi folks - I am trying to understand and figure out how to actually code/test non-linearity between …
Subscribe to:
Post Comments (Atom)
0 Response to Matching two datasets
Post a Comment