Hi, im new with the program. Im very sorry to ask about this but i'm having some trouble to run "call ols" in GAUSS 17. After running the code with GAUSS 10 in my university computers, i make some regressions and get the output without trouble. When I do the same thing on my laptop(mac), the code runs perfect but then, when i type the "call ols("",Y,X)" command, i get an error and i don't understand why. The error is: G0047: Rows don't match [ols.src, line 568].
Thank you very much
6 Answers
0
Most likely the problem is that the dimensions of your Y
and X
do not agree. To check this, run these commands before the call to ols
and see what they report:
print "rows of Y = " rows(Y);
print "cols of Y = " cols(Y);
print "rows of X = " rows(X);
print "cols of X = " cols(X);
I suspect that the number of rows will be different.
0
Thank you very much for your answer. It seems the rows are equal. I get:
rows of Y = 71.00000
cols of Y = 1.00000
rows of X = 71.00000
cols of X = 2.00000
I'm running same code (runs in both computer perfect), same data, and then apply same command (call ols("",Y,X) ) in both computers. The only difference is gauss version (and the data path of course).
thanks
0
Ahh....I think I know the problem. I see you are using GAUSS 17. I looked at line 568 in ols.src
. That line is concatenation a few things for printing the output table. I am pretty sure that the part that does not match is the variable names, because the global control variable __altnam
was set to have a different number of dimensions than your current data. Try running these commands:
__altnam = "Constant" | "Var1" | "Var2" | "Y";
call ols("", Y, X);
and I think it will work. If you set __altnam
equal to an empty string ""
, then it will set default variable names and you will not have to change __altnam
for different sized variables.
0
I've just type
__altnam = "Constant" | "Var1" | "Var2" | "Y";
call ols("", Y, X);
I have the same error message. The rare thing is that i get some descriptive stats but i don't get the coefficient estimates, its pvalues, etc. I copy paste the output:
Valid cases: 71 Dependent variable: Y
Missing cases: 0 Deletion method: None
Total SS: 1.925 Degrees of freedom: 69
R-squared: 0.521 Rbar-squared: 0.514
Residual SS: 0.922 Std error of est: 0.116
F(1,69): 75.123 Probability of F: 0.000
Standard Prob Standardized Cor with
Variable Estimate Error t-value >|t| Estimate Dep Var
-------------------------------------------------------------------------------
than you
0
It makes perfect sense that you are seeing the first half of the ols
report, because that error on line 568 of ols.src
is happening when GAUSS is making the table for the coefficient estimates, p-values, standard errors, etc.
Assuming you are still using the same 71x2 X
and 71x1 Y
, and that you did not make a mistake in typing (or copying and pasting the command), you could get this error still if you have the constant term set to off in the model. This would cause a situation where GAUSS has labels for 1 dependent variable + 2 dependent variables + 1 constant from our line: __altnam = "Constant" | "Var1" | "Var2" | "Y";
. But does not have an estimate for the constant since it was not included.
For completeness, let's have you print out all the ols
control variable information like this:
print "__con = " __con;
print "__vpad = " __vpad;
print "__miss = " __miss;
print "__altnam = " __altnam;
print "__output = " __output;
print "_olsres = " _olsres;
print "__olsalg = " __olsalg;
Y = rndn(71, 1);
X = rndn(71,2);
print "rows(Y) = " rows(Y);
print "cols(Y) = " cols(Y);
print "rows(Y) = " rows(Y);
print "cols(Y) = " cols(Y);
call ols("", Y, X);
I think we will see that the constant flag __con
is set to zero, which is causing the mismatch.
0
I run the regression =) . Thank you so much for your patience.
Your Answer
6 Answers
Most likely the problem is that the dimensions of your Y
and X
do not agree. To check this, run these commands before the call to ols
and see what they report:
print "rows of Y = " rows(Y);
print "cols of Y = " cols(Y);
print "rows of X = " rows(X);
print "cols of X = " cols(X);
I suspect that the number of rows will be different.
Thank you very much for your answer. It seems the rows are equal. I get:
rows of Y = 71.00000
cols of Y = 1.00000
rows of X = 71.00000
cols of X = 2.00000
I'm running same code (runs in both computer perfect), same data, and then apply same command (call ols("",Y,X) ) in both computers. The only difference is gauss version (and the data path of course).
thanks
Ahh....I think I know the problem. I see you are using GAUSS 17. I looked at line 568 in ols.src
. That line is concatenation a few things for printing the output table. I am pretty sure that the part that does not match is the variable names, because the global control variable __altnam
was set to have a different number of dimensions than your current data. Try running these commands:
__altnam = "Constant" | "Var1" | "Var2" | "Y";
call ols("", Y, X);
and I think it will work. If you set __altnam
equal to an empty string ""
, then it will set default variable names and you will not have to change __altnam
for different sized variables.
I've just type
__altnam = "Constant" | "Var1" | "Var2" | "Y";
call ols("", Y, X);
I have the same error message. The rare thing is that i get some descriptive stats but i don't get the coefficient estimates, its pvalues, etc. I copy paste the output:
Valid cases: 71 Dependent variable: Y
Missing cases: 0 Deletion method: None
Total SS: 1.925 Degrees of freedom: 69
R-squared: 0.521 Rbar-squared: 0.514
Residual SS: 0.922 Std error of est: 0.116
F(1,69): 75.123 Probability of F: 0.000
Standard Prob Standardized Cor with
Variable Estimate Error t-value >|t| Estimate Dep Var
-------------------------------------------------------------------------------
than you
It makes perfect sense that you are seeing the first half of the ols
report, because that error on line 568 of ols.src
is happening when GAUSS is making the table for the coefficient estimates, p-values, standard errors, etc.
Assuming you are still using the same 71x2 X
and 71x1 Y
, and that you did not make a mistake in typing (or copying and pasting the command), you could get this error still if you have the constant term set to off in the model. This would cause a situation where GAUSS has labels for 1 dependent variable + 2 dependent variables + 1 constant from our line: __altnam = "Constant" | "Var1" | "Var2" | "Y";
. But does not have an estimate for the constant since it was not included.
For completeness, let's have you print out all the ols
control variable information like this:
print "__con = " __con;
print "__vpad = " __vpad;
print "__miss = " __miss;
print "__altnam = " __altnam;
print "__output = " __output;
print "_olsres = " _olsres;
print "__olsalg = " __olsalg;
Y = rndn(71, 1);
X = rndn(71,2);
print "rows(Y) = " rows(Y);
print "cols(Y) = " cols(Y);
print "rows(Y) = " rows(Y);
print "cols(Y) = " cols(Y);
call ols("", Y, X);
I think we will see that the constant flag __con
is set to zero, which is causing the mismatch.
I run the regression =) . Thank you so much for your patience.