Creating a chart in prg

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

msemaan
Posts: 7
Joined: Fri Jul 19, 2013 7:02 pm

Creating a chart in prg

Postby msemaan » Thu Dec 18, 2014 2:01 pm

Hi

I would like to create a mutli-panel chart using results from a regression. Can someone give me a sample of code please ?

Thank you

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

Re: Creating a chart in prg

Postby EViews Gareth » Thu Dec 18, 2014 4:15 pm

Can you be more specific?

msemaan
Posts: 7
Joined: Fri Jul 19, 2013 7:02 pm

Re: Creating a chart in prg

Postby msemaan » Mon Dec 22, 2014 1:33 pm

Hi,

Once i am done with my equation (regression) i would like to create a chart with an upper paell showing the time series and the fitted value and the lower panel the standardized residuals.

What should i write after the equation to generate the fitted value and the residuals ?

Second question, what will be the transcript/code to create a two panel chart (with a zeroline in the lower panel)

Thank you so much

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

Re: Creating a chart in prg

Postby EViews Gareth » Mon Dec 22, 2014 3:25 pm

Code: Select all

create m 1990 2000 series y=nrnd series x=nrnd equation eq1.ls y c x eq1.fit yf group ys y yf freeze(graph1) ys.line eq1.makeresid res1 freeze(graph2) res1.line graph2.axis(l) zeroline graph mastergraph.merge graph1 graph2

msemaan
Posts: 7
Joined: Fri Jul 19, 2013 7:02 pm

Re: Creating a chart in prg

Postby msemaan » Mon Dec 22, 2014 3:56 pm

Thank you for the code.

The output is effectively two separate charts. How can i end up with a chart like the one i attached? two panels in the same chart charing the same x-axis for dates but with different y-axis.

Thanks a lot
Attachments
chart_eviews.png
chart_eviews.png (46.8 KiB) Viewed 6279 times

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

Re: Creating a chart in prg

Postby EViews Gareth » Mon Dec 22, 2014 4:27 pm

Code: Select all

freeze(graph3) eq1.resids

msemaan
Posts: 7
Joined: Fri Jul 19, 2013 7:02 pm

Re: Creating a chart in prg

Postby msemaan » Mon Dec 22, 2014 5:05 pm

How can i create a chart like the one attached ?

Thanks again
Attachments
Document1.pdf
(29.71 KiB) Downloaded 306 times

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

Re: Creating a chart in prg

Postby EViews Gareth » Mon Dec 22, 2014 6:18 pm

Play around with the graph options dialog until you have it the way you want it, then show it to us, and we can tell you the programming way to achieve it.

msemaan
Posts: 7
Joined: Fri Jul 19, 2013 7:02 pm

Re: Creating a chart in prg

Postby msemaan » Thu Jan 01, 2015 2:29 pm

Here you go! i am attaching a chart i adjusted the way i like it to be. Can you help with the code please ?
Last edited by msemaan on Fri Jan 02, 2015 5:32 pm, edited 1 time in total.

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

Re: Creating a chart in prg

Postby EViews Gareth » Thu Jan 01, 2015 7:26 pm

Can you provide the EViews workfile containing that graph, rather than just a picture of it?


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests