Search found 10 matches

by Marc150
Wed May 24, 2017 8:51 am
Forum: Programming
Topic: Command to assign the highest of two series
Replies: 3
Views: 4149

Re: Command to assign the highest of two series

Thank you. What about in more general instances? For example, if I wanted to pull out the largest of a list of values, e.g., something of the form: Series a=@...(b,c,..,z) that would assign a to be the highest of the values from b-z. I suppose you could do some sort of nested for loop with the @reco...
by Marc150
Tue May 23, 2017 6:59 am
Forum: Programming
Topic: Command to assign the highest of two series
Replies: 3
Views: 4149

Command to assign the highest of two series

Hi, Is there a command to assign an observation the highest of two series? So for example, suppose: series a=1 series b=2 Is there then a command of the form series c=@...(a,b) which would return c=b, because b is greater than a? In other languages the command 'max' often seems to do this. However, ...
by Marc150
Thu May 18, 2017 8:27 am
Forum: Data Manipulation
Topic: Appending empty years to a panel dataset
Replies: 3
Views: 3939

Re: Appending empty years to a panel dataset

Oh ok, thanks. Is there a way to do that within a program?
by Marc150
Thu May 18, 2017 7:39 am
Forum: Data Manipulation
Topic: Appending empty years to a panel dataset
Replies: 3
Views: 3939

Appending empty years to a panel dataset

Hi, I have a panel dataset that goes to Year t. In my code I create a Variable X that is calculated from lagged values, so that I have the necessary data to create values for Variable X up to Year t+1. However, because my initial dataset only goes to Year t, there is no cell where that could be plac...
by Marc150
Thu Apr 20, 2017 7:29 am
Forum: Data Manipulation
Topic: Generating lagged variables for panel data
Replies: 5
Views: 50539

Re: Generating lagged variables for panel data

Thanks (I've just realized that I was sampling only a subset of observations)
by Marc150
Thu Apr 20, 2017 7:09 am
Forum: Data Manipulation
Topic: Generating lagged variables for panel data
Replies: 5
Views: 50539

Generating lagged variables for panel data

Is there something special that you have to do to generate lagged variables when using panel data?
When I try the very simple code

'series a=b(-1)' or

'genr a=b(-1)'

the series a ends up having a bunch of missing values, for reasons that I don't understand.

Thanks in advance,
Marc
by Marc150
Mon Mar 20, 2017 9:50 am
Forum: Programming
Topic: Extracting a name from a string vector
Replies: 1
Views: 3121

Extracting a name from a string vector

Hi, I would like to conditionally assign names to observations under a name variable in a cross-section dataset. I have created a string vector to store the names. Then, I have tried to use a for loop to name the observations, according to the crossid values. However, EViews does not seem to recogni...
by Marc150
Fri Mar 17, 2017 2:02 pm
Forum: Programming
Topic: Using 'crossid' to name "panel units" (region)
Replies: 3
Views: 4426

Re: Using 'crossid' to name "panel units" (region)

Nvm. Thanks, again.

FYI (for anyone else reading this), the code that works is

wfcreate(wf=annual) a 1981 2015 10
alpha region
smpl if crossid=1
region="region_name"
by Marc150
Fri Mar 17, 2017 11:49 am
Forum: Programming
Topic: Using 'crossid' to name "panel units" (region)
Replies: 3
Views: 4426

Re: Using 'crossid' to name "panel units" (region)

Thanks Gareth. Sorry if I'm missing something, but when I try that I get the error message "endif found outside of loop or IF statement".
by Marc150
Fri Mar 17, 2017 11:28 am
Forum: Programming
Topic: Using 'crossid' to name "panel units" (region)
Replies: 3
Views: 4426

Using 'crossid' to name "panel units" (region)

Hi, I am trying to create a panel data set, and I want to assign names to the regions for which I have data. My code looks something like this: wfcreate(wf=annual) a 1981 2015 10 alpha region if crossid=1 then region=region_name endif However, this doesn't work to assign names to the region variable...

Go to advanced search