全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 MATLAB等数学软件专版
660 0
2018-11-28
我的数据如下
groupagegenderw1_L23w2_L23w3_L23w4_L23w9_L23w10_L23w11_L23w12_L23w13_L23w14_L23w15_L23w16_L23

1

39

2

0.00048934

0.00048125

0.00040931

0.0004255

0.00020593

0.00045425

0.00056187

0.00050043

0.00054251

0.00049149

0.00048999

0.00056272

1

38

2

0.00048676

0.00044408

0.0004069

0.00040205

0.00025213

0.00046608

0.00055177

0.00051316

0.00055771

0.00050599

0.00051824

0.00056767

1

46

2

0.00055349

0.00052201

0.00045777

0.00044832

0.00027044

0.00046693

0.00063774

0.00056754

0.00062244

0.00053948

0.00055979

0.00059962

1

50

2

0.00052916

0.00049142

0.00042397

0.00042213

0.00024717

0.00051128

0.000604

0.00060899

0.00056069

0.00061936

0.00050899

0.00057253

1

35

2

0.00052933

0.00047794

0.00043655

0.00043347

0.00026902

0.0004713

0.00055875

0.00050828

0.00052225

0.00049025

0.00054317

0.00052335

1

46

2

0.00058642

0.00049027

0.00043232

0.00043498

0.00022233

0.00052598

0.00055477

0.00055934

0.00053926

0.00048554

0.00054042

0.00062385

1

49

2

0.00053186

0.00051969

0.00047144

0.00047615

0.00025114

0.00052077

0.00058964

0.00053496

0.00056103

0.0005329

0.00053276

0.00054893

1

23

2

0.00054093

0.00051823

0.00043891

0.00043495

0.00025734

0.00045432

0.00053053

0.00050735

0.00053407

0.00049193

0.00050876

0.00059122

1

38

2

0.00053369

0.00051097

0.00043166

0.00044269

0.00025567

0.00049064

0.00060453

0.00053866

0.00056756

0.00048999

0.00051148

0.00061892

1

17

2

0.00055267

0.0005759

0.0004726

0.00045626

0.00019977

0.00048307

0.00058845

0.00050955

0.0005923

0.00048274

0.00057332

0.00058334

1

9

2

0.0005781

0.0005417

0.0004712

0.0004525

0.0001963

0.0005268

0.000612

0.0005141

0.0006014

0.0005291

0.0005918

0.0006853

2

23

2

0.00048296

0.00046872

0.00041709

0.00043736

0.0001885

0.00043021

0.00051847

0.00051246

0.00055395

0.00053122

0.00055429

0.00062054

2

22

2

0.00047386

0.00042435

0.00042383

0.0004135

0.00019926

0.00044278

0.00050714

0.00045647

0.00049887

0.00045949

0.00046617

0.00051184

2

22

2

0.00051399

0.0004793

0.00041779

0.00043556

0.00022258

0.00048229

0.00058604

0.00052352

0.00057912

0.00050811

0.00054008

0.00058465

2

21

2

0.00049093

0.00045711

0.00042329

0.0004207

0.0001663

0.00040567

0.00051277

0.00046372

0.00049682

0.00044605

0.00051226

0.00053261

2

38

2

0.00052341

0.00042068

0.00039733

0.00039069

0.00022618

0.00044605

0.00053764

0.00049907

0.00051528

0.00048091

0.00052887

0.00056241

2

44

2

0.00049896

0.00046445

0.00039754

0.00040291

0.00023695

0.00046161

0.00052311

0.0004755

0.00053215

0.0004758

0.00050695

0.0005711

2

44

2

0.00054377

0.00046438

0.00042202

0.00041536

0.0002126

0.00048062

0.00056036

0.00045846

0.00053625

0.00046581

0.0005078

0.00050837

2

43

2

0.00047567

0.00047745

0.00040075

0.00040218

0.00020707

0.00046934

0.00054347

0.00050797

0.00052715

0.00048344

0.00049775

0.00059841

2

26

2

0.00047333

0.000447

0.0003877

0.00039676

0.0002328

0.00040346

0.00053692

0.0004886

0.00050649

0.00048021

0.00051271

0.00057109

2

11

2

0.0004993

0.0004578

0.0003898

0.0003621

0.0002119

0.0004642

0.0005414

0.0005162

0.0005151

0.0005288

0.0005024

0.0005342


我编写的脚本如下
<code>

clear
clc
%[num,txt,raw] = xlsread(___)  returns the numeric data in array num,the text fields in cell array txt, and the unprocessed data (numbers and text) in cell array raw
[num,txt,raw] = xlsread('E:\LHON_DTI_bydinghao\FA_mask\tbss_lmm\pcorr\nc_cr_regree_robust.xls');% the data is extracted from fa907.xls
% get the type of variable out into different matrix
%get the group
group=num(:,1);
age=num(:,2);
gender=num(:,3);
title_num=txt(:,2:28);
l23=num(:,4:15);
% FA=num(:,16:27);

%regress out age and sex for fa
statsvalue=zeros(3,12);
for i=1:12
%这一块的程序不会编,
%should use this command https://ww2.mathworks.cn/help/st ... cal-covariates.html   
%fit = fitlm(group,fa(:,i)); %but fitlm doesn't exist.
[b,dev,stats] = glmfit(group,[l23(:,i)],'normal');
% statsvalue(1,i)=h;
% statsvalue(2,i)=t;
% statsvalue(3,i)=p;
end
% [pthr,pcor,padj] = fdr(statsvalue(3,:),0.05);
% new=[statsvalue,padj];</code>

其实我也可以使用stata的命令regress  w1_L23 group c.age gender来做,但是那样的缺点是我需要反复拷贝t值和p值,而且还要做一个多重校正,如果使用matlab就可以一步到位.但是fitlm程序居然没有,而glmfit给出了两组各自的回归系数,但是没有进行进一步的统计.各位老师能否指导一下.

二维码

扫码加我 拉你入群

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

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

栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群