Count value in a series with some condition

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator

Lalan_dk
Posts: 17
Joined: Tue Apr 10, 2018 9:51 pm

Count value in a series with some condition

Postby Lalan_dk » Tue Aug 21, 2018 1:15 am

Hi,

I have 15000 household data that have some member in every houshold. I want to count the number of household member that have age more than 60 years old in every houshold.

What command that should i use?
Thx

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 11875
Joined: Tue Sep 16, 2008 5:38 pm

Re: Count value in a series with some condition

Postby EViews Gareth » Tue Aug 21, 2018 6:20 am

Code: Select all

Smpl if age>60
=@obssmpl
Follow us on Twitter @IHSEViews

startz
Non-normality and collinearity are NOT problems!
Posts: 3384
Joined: Wed Sep 17, 2008 2:25 pm

Re: Count value in a series with some condition

Postby startz » Tue Aug 21, 2018 8:39 am

If what you meant was separate counts for each household, something like

Code: Select all

smpl if age>60
count = @obsby(householdID,householdid)

Lalan_dk
Posts: 17
Joined: Tue Apr 10, 2018 9:51 pm

Re: Count value in a series with some condition

Postby Lalan_dk » Wed Aug 22, 2018 10:13 am

Thank you Glenn and startz


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 13 guests