Page 1 of 2

Sample

Posted: Mon Oct 16, 2017 5:29 am
by mpsc19
Hello, how can I reduce a sample by looking only at households with a boss and children between the ages of 18 and 30? Households with bosses but no children with those ages do not interest me

boss: ch03=1
children: ch03=3
between ages of 19 and 30: (ch06>=18 and ch06<=30)

I previously did this: (ch03=1 or (ch03=3 and ch06>=18 and ch06<=30)) but also appear households with bosses alone, that is, if the "x" household has a boss with 15 year old children, he shows me that same home but only shows me the boss, and this does not help me, I do not want to see that home

Sorry for my english. Using Eviews 7

Re: Sample

Posted: Mon Oct 16, 2017 6:14 am
by startz
Try changing "or" to "and"

Re: Sample

Posted: Mon Oct 16, 2017 6:18 am
by mpsc19
There I did but no, only the bosses are now

Re: Sample

Posted: Mon Oct 16, 2017 6:22 am
by startz
How is your data structured?

Re: Sample

Posted: Mon Oct 16, 2017 6:25 am
by mpsc19
Unstructured/Undated

Re: Sample

Posted: Mon Oct 16, 2017 6:50 am
by startz
Ah, you can't very well have ch03 take on two different values in one observation. So how can an observation be both boss and children?

Re: Sample

Posted: Mon Oct 16, 2017 6:57 am
by mpsc19
I'm trying to sort the information to make a data panel. I don't want a single observation to take two values, I just want to reduce the sample to show me only the households where there is a boss and children with those ages

Re: Sample

Posted: Mon Oct 16, 2017 8:06 am
by startz
I suspect, but don't know, that you have separate observations for each household member. If that's so, how are they linked?

Re: Sample

Posted: Mon Oct 16, 2017 8:32 am
by mpsc19
Yes, for example, the code of a household is: 257695 .the variable that has the codes of the homes is called "codusu"
In a house there may be more than one family, every family has its code, the variable that has the family codes is "nro_hogar"
In each family there is an individual, if there is a boss, is assigned the number 1, if there is a spouse, is assigned the number 2, the children is assigned the number 3 and so ... the variable that assigns the number to each individual is called a "componente"

what I did to link the three variables is:

series a4=@val(codusu)
alpha a5=@str(a4)+@str(nro_hogar) + @str(componente)

in this way, the code would be, for example: 25769511 if I am seeing the head of the family 1 of that home


in the other post where I showed what I did, I use the variable "ch03" which is the one that shows the relations of kinship, which in this case, coincides with the variable "componente"

Re: Sample

Posted: Mon Oct 16, 2017 9:17 am
by startz
The problem would seem to be that if you are looking at the record for a spouse or someone else, there is nothing in that record which indicates that another record has a boss.

Re: Sample

Posted: Mon Oct 16, 2017 9:51 am
by mpsc19
Mmmm, ok, I understand what you say, but I know all records have a boss. no way to do it?

Re: Sample

Posted: Mon Oct 16, 2017 9:53 am
by startz
I don't think I understand. If all records have a boss, then why do you have to check whether they have a boss?

Re: Sample

Posted: Mon Oct 16, 2017 10:06 am
by mpsc19
Look, i put this: smpl @all if (ch03=1 or (ch03=3 and ch06>=18 and ch06<=30))
then I have all the households with heads that have children between 18 and 30 years, but also appear the heads of other households that do not meet that condition, for example, in the image the first ten observations are from households that do not have children between those ages, until, for example, it shows that at home 1252151 (codusu + nro_hogar) there is a boss who has a child between those ages, I just want to see in that square only these homes (like 1253361, 1253661) not households as the top 10

Jefe= boss
Hijo/hijastro= child


Image

Re: Sample

Posted: Mon Oct 16, 2017 10:12 am
by startz
Does

Code: Select all

smpl @all if (ch03=1 and ch06>=18 and ch06<=30) or (ch03=3 and ch06>=18 and ch06<=30)
do what you want?

Re: Sample

Posted: Mon Oct 16, 2017 10:18 am
by mpsc19
No :(
I also appreciate your help, very kind !!