Importing Data as Panel Data to apply Diff-in-Diff

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

klotzle
Posts: 13
Joined: Mon Feb 16, 2009 1:29 pm

Importing Data as Panel Data to apply Diff-in-Diff

Postby klotzle » Thu Nov 03, 2022 1:26 pm

Dear Ladies and Gentlemen,
I have following xls attached and I do not know how to import it in eviews as panel data.
The first line is he return for a low sustainability fund and the second line for a high sustainability fund.
This is why I repeat the date: 0/01/2022 two times and so on. I included a line for control being 0 (low sustainability fund) before 21/02/2021 and 1 (high sustaiability fund, the treatment) after, where there was a shock in covid.
I know that I cannot repeat the dates, I put 1.1, 1.2 , 2.1, 2.2, but this do not work.
When I import i does regonize as panel data.
Can you help me in this regard.
Best
Marcelo
I
Attachments
Cópia de DIFF in DIFF 1.xlsx
(15.78 KiB) Downloaded 109 times

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

Re: Importing Data as Panel Data to apply Diff-in-Diff

Postby EViews Gareth » Thu Nov 03, 2022 2:56 pm

Just so I'm certain I know what you're trying to do - you have two cross-sections: High and Low. But you don't have a column, in Excel, indicating which cross-section each observation is in, you're just rely on observation order? (which is fine, just checking I understand).
Follow us on Twitter @IHSEViews

klotzle
Posts: 13
Joined: Mon Feb 16, 2009 1:29 pm

Re: Importing Data as Panel Data to apply Diff-in-Diff

Postby klotzle » Wed Nov 16, 2022 3:30 am

Yes Gareth Thanks. I don’t know how to specify in eviews the dates to identify Each series so that i can import it as panel data and Apply Diff in Diff.
Best
Marcelo

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

Re: Importing Data as Panel Data to apply Diff-in-Diff

Postby EViews Gareth » Wed Nov 16, 2022 10:42 am

Code: Select all

wfopen "Cópia de DIFF in DIFF 1.xlsx"


'create an alpha series containing the cross-section (low or high)
alpha fund = "LOW"   'set every observation to "low"
smpl if date=date(-1)  'set the sample to observations where the value in the date series is equal to the previous observations' value.
fund = "HIGH" 'set these observatons to "high"

smpl @all

pagestruct fund @date(date)   'structure the page as a panel with dates and fund as the cross-sections.
Follow us on Twitter @IHSEViews

klotzle
Posts: 13
Joined: Mon Feb 16, 2009 1:29 pm

Re: Importing Data as Panel Data to apply Diff-in-Diff

Postby klotzle » Thu Nov 17, 2022 12:46 pm

Thanks Gareth!


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 45 guests