Sample
Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt
Sample
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
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
-
- Non-normality and collinearity are NOT problems!
- Posts: 3775
- Joined: Wed Sep 17, 2008 2:25 pm
Re: Sample
Try changing "or" to "and"
Re: Sample
There I did but no, only the bosses are now
-
- Non-normality and collinearity are NOT problems!
- Posts: 3775
- Joined: Wed Sep 17, 2008 2:25 pm
Re: Sample
How is your data structured?
-
- Non-normality and collinearity are NOT problems!
- Posts: 3775
- Joined: Wed Sep 17, 2008 2:25 pm
Re: Sample
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
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
-
- Non-normality and collinearity are NOT problems!
- Posts: 3775
- Joined: Wed Sep 17, 2008 2:25 pm
Re: Sample
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
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"
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"
-
- Non-normality and collinearity are NOT problems!
- Posts: 3775
- Joined: Wed Sep 17, 2008 2:25 pm
Re: Sample
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
Mmmm, ok, I understand what you say, but I know all records have a boss. no way to do it?
-
- Non-normality and collinearity are NOT problems!
- Posts: 3775
- Joined: Wed Sep 17, 2008 2:25 pm
Re: Sample
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
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
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
-
- Non-normality and collinearity are NOT problems!
- Posts: 3775
- Joined: Wed Sep 17, 2008 2:25 pm
Re: Sample
Does
do what you want?
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
No
I also appreciate your help, very kind !!
I also appreciate your help, very kind !!
Who is online
Users browsing this forum: No registered users and 32 guests