Problems with "C" (constant)

For questions regarding programming in the EViews programming language.

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

mpalmi
Posts: 4
Joined: Tue Aug 28, 2012 4:25 pm

Problems with "C" (constant)

Postby mpalmi » Tue Aug 28, 2012 4:35 pm

Solved.
Delete it, please.
Regards,

Manuel Palmi
Last edited by mpalmi on Mon Sep 03, 2012 7:15 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: Problems with "C" (constant)

Postby EViews Gareth » Tue Aug 28, 2012 4:55 pm

Hi.

Sorry, but I can't understand your question. I don't know what "The "C" or beta overcame the sample and it always until to R751, really I don't know why!" means :(

mpalmi
Posts: 4
Joined: Tue Aug 28, 2012 4:25 pm

Re: Problems with "C" (constant)

Postby mpalmi » Tue Aug 28, 2012 11:35 pm

Hi!

Thank you for your answer. I uploaded a file, really, I don't know how explain it, but for example: If you put in a text

"wf u 1 51"

I'll hope only see 51 "C", betas, constants, intercepts, etc... However I'm seeing 751 (R751) and not 51!

Regards!
Attachments
c.JPG
(constant or beta)
c.JPG (88.72 KiB) Viewed 16423 times

trubador
Did you use forum search?
Posts: 1520
Joined: Thu Nov 20, 2008 12:04 pm

Re: Problems with "C" (constant)

Postby trubador » Tue Aug 28, 2012 11:51 pm

When you create a workfile, you define the sample period that does not apply to vectors and matrices. Otherwise, you would not be able to make operations on matrices that have more observations than the sample size. "C" is a predefined (and reserved) coefficient vector of size 751 and gives you the flexibility of running/solving large scale equations/models without worrying about betas. If you ever need a larger coefficent vector, you can always explicitly define your own coefficient vector and use it in your calculations.

mpalmi
Posts: 4
Joined: Tue Aug 28, 2012 4:25 pm

Re: Problems with "C" (constant)

Postby mpalmi » Wed Aug 29, 2012 1:17 am

Hi,

I don't understand the relation between "my problem" with the matrices. Not only if i write "wf u 1 51" i'll see the same problem, for example if i put File / New / Workfile / Unstructured - Undated -> Observations 51, there is the same problem; with all options (Dated-Regular -> Anual, Monthly, Weekly, etc.), again, there is the same problem, etc, etc.

Anyone know a solution? Maybe I changed a "configuration of default" (I don't remember) but I don't find nothing.

Regards,

startz
Non-normality and collinearity are NOT problems!
Posts: 3798
Joined: Wed Sep 17, 2008 2:25 pm

Problems with "C" (constant)

Postby startz » Wed Aug 29, 2012 2:13 am

Why do you think you have a problem? C is not used for storing data.

mpalmi
Posts: 4
Joined: Tue Aug 28, 2012 4:25 pm

Re: Problems with "C" (constant)

Postby mpalmi » Wed Aug 29, 2012 11:08 pm

Hi again,

For example, in this post where I'm using the "Sample Programs" of Eviews 6. Its in "logl file" -> gprobit1.

============================================================

' GPROBIT1.PRG (1.0 - 6/29/98)
' example program for EViews LogL object
' checked for version 6.0 (3/7/2007)
' grouped (proportions) data probit
'
' Problem 6, page 947 of Greene, William H. (1997) Econometric Analysis,
' 3rd edition, Prentice-Hall

' create workfile
wfcreate gprobit u 10

' fill data
series trucks
trucks.fill 160,250,170,365,210,206,203,305,270,340
series prate
prate.fill 11,74,8,87,62,83,48,84,71,79
prate = prate/100

' set up likelihood for probit
logl ll1
ll1.append @logl logl1
ll1.append xb = c(1)+c(2)*trucks
ll1.append logl1 = prate*log(@cnorm(xb)) + (1-prate)*log(1-@cnorm(xb))

' analytic derivatives
ll1.append @deriv c(1) grad1 c(2) grad2
ll1.append mills1 = @dnorm(xb)/@cnorm(xb)
ll1.append mills2 = -@dnorm(xb)/(1-@cnorm(xb))
ll1.append grad1 = prate*mills1+(1-prate)*mills2
ll1.append grad2 = prate*mills1*trucks+(1-prate)*mills2*trucks

' set OLS starting values
equation eq1.ls prate c trucks

' do MLE
ll1.ml(showopts, m=1000, c=1e-5)
show ll1.output

' create table for answer to problems
table(3,2) ans
setcolwidth(ans,1,30)

' problem 6(a)
setcell(ans,1,1, "answer to 6(a)","l")
scalar ans_a = ( @qnorm(.95)-ll1.c(1) )/ll1.c(2)
ans(1,2) = ans_a

' problem 6(b)
' ans_b is the expected participation rate if budget 6.5 million
setcell(ans,2,1,"expected participation rate","l")
scalar ans_b = @cnorm( ll1.c(1)+ll1.c(2)*650/2 )
ans(2,2) = ans_b

' problem 6(c)
setcell(ans,3,1,"marginal participation rate at 301","l")
scalar ans_c = ll1.c(2)*@dnorm( ll1.c(1)+ll1.c(2)*301 )
ans(3,2) = ans_c

show ans
============================================================

All know which its ok, however, (how you can see the picture) the "Constant" (beta, c, any...) not "take up" the regression, and all seeing:

R1 -2.050451
R2 0.009602
R3 0.000000
R4 0.000000
R5 0.000000
.
.
R751 0.000000

Now, Can you understand me?
Thanks all
Regards,
Attachments
thesameproblem(c).JPG
thesameproblem(c).JPG (104.29 KiB) Viewed 16394 times

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

Re: Problems with "C" (constant)

Postby EViews Gareth » Thu Aug 30, 2012 6:54 am

It is nothing to worry about. C is always exactly the same size in all workfiles.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests