How to compute p-value with Empirical Distribution

For questions regarding programming in the EViews programming language.

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

tcfoon
Posts: 54
Joined: Fri May 15, 2009 4:33 am

How to compute p-value with Empirical Distribution

Postby tcfoon » Sun Aug 16, 2009 11:05 pm

Dear All,

I would like to know how can I compute the p-value from an empirical distribution generated from bootstrapping. I found some existing post in this Forum on p-value but all of them are computed based on the theoretical distribution.

Simply, what is the programming code if I have a distribution of 1000 F-statistics.

Thank you,
CF Tang

theologos
Posts: 25
Joined: Wed Mar 11, 2009 6:09 am

Re: How to compute p-value with Empirical Distribution

Postby theologos » Mon Aug 17, 2009 2:44 am

Hi,

I think the solution to your problem is quite easy. Simply remember the definition of the p-value and that’s it. The following paper will help you since the authors perform a similar task. (page 619)

http://journals.cambridge.org/action/di ... id=1389068

regards

Amber
Posts: 31
Joined: Wed Aug 03, 2011 4:35 am

Re: How to compute p-value with Empirical Distribution

Postby Amber » Fri Sep 30, 2011 6:03 am

Dear Gareth,

I also have the same problem as Tang. But in my case, it is just simply calculate a given dot's p-value of the empirical distribution.

Is the p-value for the given dot (suppose it is 2) also the percentile in the empirical distribution? Or different? It so, would you please kindly teach me the code?

I really appreciate!

Amber

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

How to compute p-value with Empirical Distribution

Postby EViews Gareth » Fri Sep 30, 2011 6:54 am

I don't understand your question.

Amber
Posts: 31
Joined: Wed Aug 03, 2011 4:35 am

Re: How to compute p-value with Empirical Distribution

Postby Amber » Fri Sep 30, 2011 7:02 am

Dear Gareth,

I have run the bootstrap for constant term of the regression for 1000 times, and get the distribution for constant term.

Now I want to get the p-value for the empirically regressed constant term (for instance 1.9) on the bootstrapped constant distribution, how can I code it?

I have tried:

smpl if constant>1.9
scalar pval=@obs(constant)/1000

Is it correct?

Thanks!

Amber

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

Re: How to compute p-value with Empirical Distribution

Postby EViews Gareth » Fri Sep 30, 2011 7:49 am

Why don't you state mathematically what you're trying to do, then we can decide if your code matches up with it.

Amber
Posts: 31
Joined: Wed Aug 03, 2011 4:35 am

Re: How to compute p-value with Empirical Distribution

Postby Amber » Fri Sep 30, 2011 8:55 am

Dear Gareth, 1. I ran regression y=c+beta*x, and get the c as empirical_c.
2. I bootstrapped 1000 times on residuals from step 1, to get 1000 bootstrapped c. And also get the bootstrap distribution for boot_c.
3. I want to get the p-value/percentile of empirical c in boot_c distribution. And this is the step I got stuck.
Hope this makes it a bit clearer.
Cheers,

Amber


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests