为什么加群总是被拒绝~~。。。。。想问的是:总是提示错误:未定义函数或变量 'prt_reg',找了一个这个命令做了脚本,运行又出现
clc
clear all
close all
load('C:\Users\sony\Desktop\分析\数据\MATLAB\agent30.mat')
load('C:\Users\sony\Desktop\分析\数据\MATLAB\W相邻.mat')
T=8; % number of time periods
N=30; % number of regions
y=agents1(:,4); % column number in the data matrix that corresponds to the dependent variable
x=agents1(:,[8:11,13:15,17,18,20:23]); % column numbers in the data matrix that correspond to the independent variables
xconstant=ones(N*T,1);
[nobs, K]=size(x);
% ----------------------------------------------------------------------------------------
% ols estimation
results=ols(y,[xconstant x]);
results.nobs=nobs;
results.nvar=K;
vnames=strvcat('y1','intercept','x1','x2','x3','x4','x51','x6','x7','x9','x11','x13','x114','x16');
prt_reg(results,vnames,1);
sige=results.sige*((nobs-K)/nobs);
loglikols=-nobs/2*log(2*pi*sige)-1/(2*sige)*results.resid'*results.resid;
|