Page 1 of 1

how to calculte the number of different obs in a series

Posted: Wed Jul 04, 2012 8:17 am
by xubin1988
for example, i have a series: {1,1,2,3,4,5,6,6}
the observation number of this series is 8, which I think can be retrieved by the function of @obs
but the number of different variables in this series is 6

how to achieve the second purpose by the functions in eview?

Thanks in advance !!!

Re: how to calculte the number of different obs in a series

Posted: Wed Jul 04, 2012 9:58 am
by EViews Gareth
Open the series, and then choose View->One Way Tabulation.

Re: how to calculte the number of different obs in a series

Posted: Wed Jul 04, 2012 10:06 am
by xubin1988
Open the series, and then choose View->One Way Tabulation.
hey thanks for answering!
how one way tabulation can cont the different numbers in a series?
and i have so many series to do this manipulation
so do you know how to run this count by evews functions?

Re: how to calculte the number of different obs in a series

Posted: Wed Jul 04, 2012 11:03 am
by EViews Gareth
There is no function that will return the number of unique values in a series. You can easily see the number of unique values with a one-way tabulation, though.

To perform one-way tabulation in a program, you can use series.freq

Re: how to calculte the number of different obs in a series

Posted: Wed Jul 04, 2012 11:53 am
by xubin1988
There is no function that will return the number of unique values in a series. You can easily see the number of unique values with a one-way tabulation, though.

To perform one-way tabulation in a program, you can use series.freq
hi,

i see how to use one way tabulation to count unique number now

can you tell me how to conduct such operation by functions?

I think there would be a function if i can use it by clicking mouse

Re: how to calculte the number of different obs in a series

Posted: Wed Jul 04, 2012 11:54 am
by xubin1988
There is no function that will return the number of unique values in a series. You can easily see the number of unique values with a one-way tabulation, though.

To perform one-way tabulation in a program, you can use series.freq
or can you figure out a code to solve my problem?

thanks in advance!!

Re: how to calculte the number of different obs in a series

Posted: Wed Jul 04, 2012 12:31 pm
by EViews Gareth
To perform one-way tabulation in a program, you can use series.freq

Re: how to calculte the number of different obs in a series

Posted: Thu Sep 10, 2015 10:27 am
by CharlieEVIEWS
Lot of views on this thread so I thought I'd post:

Code: Select all

freeze(seriesfreq) myseries.freq scalar numberunique = @val(@mid(seriesfreq(5,1),22))
Should do the trick. Works for alphas too.

Re: how to calculte the number of different obs in a series

Posted: Thu Sep 10, 2015 10:37 am
by EViews Gareth
Since this thread was originally posted, the @uniquevals function was added to EViews. Much easier to use that programmatically.

Re: how to calculte the number of different obs in a series

Posted: Thu Sep 10, 2015 10:56 am
by CharlieEVIEWS
i need there to be a ::facepalm:: smilie. still might come in useful for somebody one day though.