Help me please, Error G0047: Rows don't match [Modelo_2.gss, line 53]

Hi, I hope each of you is doing very well, I need someone to help me with the following Error G0047: Rows don't match [Modelo_2.gss, line 53] I have highlighted the line with the error.

Although I find that the rows match, the error still persists. I ask someone please to check the codes

From already thank you very much.

 

new;
format /m1 /rd 13,4;

load data[243,8]= "Base_Modelo2.txt";
dint=data[.,1];
e_loss=data[.,2];
tcn=ln(data[.,3]);
g_12=data[.,4];
hp_g_12=data[.,5];
inf_12=data[.,6];
reserv=ln(data[.,7]);
h=data[.,8];
gdp_gap=g_12-hp_g_12;
inf_gap=inf_12-3;

x=ones(243,1)~tcn~gdp_gap~inf_gap~reserv~h;

b0=1|0|0|0|0|0;
proc (1)= of_probit(b);
local ln_lik,s_ln_lik;
ln_lik=dint.*ln(cdfN(e_loss-x*b))+(1-dint).*ln(1-cdfN(e_loss-x*b));
s_ln_lik=sumc(ln_lik);
retp(-s_ln_lik);
endp;

{ b,s_ln_lik,g,retcode } = QNewton(&of_probit,b0);

hm = hessp(&of_probit,b);
sd= sqrt(diag(inv(hm)));
tt=b ./ sd;
pv= 2*cdfnc(abs(tt));

const=ones(243,1);
bc0=1;
proc (1)= of_probitc(bc);
local llk_r,s_llk_r;
llk_r=dint.*ln(cdfN(e_loss-const*bc))+(1-dint).*ln(1-cdfN(e_loss-const*bc));
s_llk_r=sumc(llk_r);
retp(-s_llk_r);

endp;

{ bc,s_llk_r,g,retcode } = QNewton(&of_probitc,bc0);

r2=1-(-s_ln_lik/-s_llk_r);
r2_adj=1-(243-1)/(243-rows(b))*(1-r2);

let vnames = C tcn gdp_gap inf_gap reserv h;
let hnames = Variable,Coeff,Std.Dev,t-test,p_value;
print;
print "Probit Estimation for Probability of FX Intervention:";
print $hnames';
res_m=vnames~b~sd~tt~pv;
mask = { 0 1 1 1 1};
call printfmt(res_m, mask);
print;
print "Pseudo-R2:" r2;
print "Pseudo-R2-Adj:" r2_adj;

end;

1 Answer



0



Add this print statement right before the line you have bolded. Like this:

print "rows of vnames = " rows(vnames);
print "rows of b = " rows(b);
print "rows of sd = " rows(sd);
print "rows of tt = " rows(tt);
print "rows of tt = " rows(pv);

res_m=vnames~b~sd~tt~pv;

This will show you how many rows each of the matrices or vectors have, so that you can see where the problem is.

aptech

1,773

Your Answer

1 Answer

0

Add this print statement right before the line you have bolded. Like this:

print "rows of vnames = " rows(vnames);
print "rows of b = " rows(b);
print "rows of sd = " rows(sd);
print "rows of tt = " rows(tt);
print "rows of tt = " rows(pv);

res_m=vnames~b~sd~tt~pv;

This will show you how many rows each of the matrices or vectors have, so that you can see where the problem is.


You must login to post answers.

Have a Specific Question?

Get a real answer from a real person

Need Support?

Get help from our friendly experts.