楼主: snowsmile1211
3420 5

[其它] matlab程序求助(面板数据问题) [推广有奖]

  • 9关注
  • 0粉丝

博士生

27%

还不是VIP/贵宾

-

威望
0
论坛币
209 个
通用积分
7.0303
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
10166 点
帖子
161
精华
0
在线时间
239 小时
注册时间
2009-10-25
最后登录
2023-3-21

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
请高手帮我看看在检验数据完整性的那部分,每行程序的作用,我没明白他是怎么找到数据缺失位置的,以及end后面的那几句有什么用?
Y=data(:,1);                                    % Endogeneous Variable 内生变量(数据第一列)

Q=data(:,2);                                    % Threshold Variable (Identical for all threshold variables)转换变量(数据第2列)

X=data(:,3:end);                                % Matrix of Explicative Variables 解释变量矩阵(数据第3列以后所有行)??

N=N0;                                           % Number of Individual 变量个数

T=length(Y)/N;                                  % Time Dimension 时间域

NT=N*T;                                         % Total number of observations 观测值总数

K=size(X,2);                                    % Number of Explicative Variables 解释变量个数

%-------------------------
%---- Balanced Sample ----(样本完整性)
%-------------------------

balanced=1;                                                             % balanced=1 if the sample is balanced 当样本值完整时,balance=1

if sum(sum(isnan(data)))>0                                              % Not Balanced Sample(
    disp(' '),disp(' WARNING: The sample is not balanced'),disp(' ')    %显示 WARNING: The sample is not balanced

    balanced=0;                                                         % balanced=0 if the sample is not balanced 当样本数值不完整,balance=0;

end

missing=sum(isnan(data)')';                                             % Location of Missing Values 丢失数据的位置                        

sample(:,1)=ones(length(Y),1);                                          %使数据第一列全部等于1
sample(missing>0)=0;                                                    % Sample of Complete Data  ???      

balanced_indi=repmat((1:N),T,1);sample(:,2)=balanced_indi(:);           % Index of Individuals??

sample(:,3)=repmat((1:T),1,N)';                                         % Index of Time??

Qadj=Q(sample(:,1)==1);                                                 % Values of Qit on the Adjuted Sample??

Xadj=X(sample(:,1)==1,:);                                               % Values of Xit on the Adjuted Sample??

sampleAdj=sample(sample(:,1)==1,:);                                     % Adjusted Sample??

NT=sum(sample(:,1));                                                    % Total number of observations??
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:MATLAB程序 MATLAB matla atlab 面板数据 matlab Matrix 程序

沙发
floydgyf 在职认证  发表于 2012-9-13 17:29:42 |只看作者 |坛友微信交流群
sample(missing>0)=0;   就是把确实数据补充为0

使用道具

藤椅
Kìss;敏 发表于 2012-9-13 17:42:28 |只看作者 |坛友微信交流群

使用道具

板凳
snowsmile1211 发表于 2012-9-13 19:07:17 |只看作者 |坛友微信交流群
floydgyf 发表于 2012-9-13 17:29
sample(missing>0)=0;   就是把确实数据补充为0
能具体解释一下是如何找到missing位置的么?我没看懂。还有,后面的语句是做什么的呢?

使用道具

报纸
floydgyf 在职认证  发表于 2012-9-14 08:48:28 |只看作者 |坛友微信交流群
missing=sum(isnan(data)')';   
% Location of Missing Values 丢失数据的位置

使用道具

地板
xiaochangjiang 发表于 2012-9-24 21:53:13 |只看作者 |坛友微信交流群
面板数据在eviews里面似乎更方便一点吧

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加JingGuanBbs
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-5-1 12:39