collecting data for chi squared test

1 次查看(过去 30 天)
Hello,
I have this data. I import it into matlab and and I need to fill that table out. Can you please give me a hint on how to fill it in a time efficient manner.
  2 个评论
Rik
Rik 2022-4-29
If you post the non-efficient code, we can help you optimize it.
Christos Papagrigoriou
Hello,
table1 = (strcmp(NSCLCR01RadiogenomicDATALABEL.KrasMutation, 'Mutant') & strcmp(NSCLCR01RadiogenomicDATALABEL.SmokingStatus, 'Current'), :);
It turns back a hollow table 0x17

请先登录,再进行评论。

采纳的回答

Voss
Voss 2022-4-30
C = readcell('NSCLCR01Radiogenomic_DATA_LABEL.xlsx');
C(:,[4 6 8 10 18:end]) = [];
headers = C(1,:);
C(1,:) = [];
t = cell2table(C,'VariableNames',headers)
t = 210×13 table
Case ID Patient affiliation Age at Histological Diagnosis Gender Smoking status Histology EGFR mutation status KRAS mutation status ALK translocation status Adjuvant Treatment Chemotherapy Radiation Recurrence ___________ ___________________ _____________________________ __________ ______________ __________________ ____________________ ____________________ ________________________ __________________ ____________ _________ __________ {'AMC-001'} {'Stanford'} 34 {'Male' } {'Nonsmoker'} {'Adenocarcinoma'} {'Wildtype' } {'Mutant' } {'Wildtype' } {'No' } {'No' } {'No'} {'yes'} {'AMC-002'} {'Stanford'} 33 {'Female'} {'Nonsmoker'} {'Adenocarcinoma'} {'Wildtype' } {'Wildtype' } {'Not collected'} {'No' } {'No' } {'No'} {'no' } {'AMC-003'} {'Stanford'} 69 {'Female'} {'Nonsmoker'} {'Adenocarcinoma'} {'Mutant' } {'Wildtype' } {'Wildtype' } {'No' } {'No' } {'No'} {'no' } {'AMC-004'} {'Stanford'} 80 {'Female'} {'Nonsmoker'} {'Adenocarcinoma'} {'Wildtype' } {'Wildtype' } {'Wildtype' } {'No' } {'No' } {'No'} {'no' } {'AMC-005'} {'Stanford'} 76 {'Male' } {'Former' } {'Adenocarcinoma'} {'Mutant' } {'Wildtype' } {'Wildtype' } {'No' } {'No' } {'No'} {'yes'} {'AMC-006'} {'Stanford'} 80 {'Female'} {'Former' } {'Adenocarcinoma'} {'Wildtype' } {'Not collected'} {'Not collected'} {'No' } {'No' } {'No'} {'no' } {'AMC-007'} {'Stanford'} 56 {'Female'} {'Nonsmoker'} {'Adenocarcinoma'} {'Wildtype' } {'Wildtype' } {'Not collected'} {'No' } {'No' } {'No'} {'no' } {'AMC-008'} {'Stanford'} 65 {'Female'} {'Former' } {'Adenocarcinoma'} {'Not collected'} {'Mutant' } {'Not collected'} {'No' } {'No' } {'No'} {'no' } {'AMC-009'} {'Stanford'} 61 {'Male' } {'Former' } {'Adenocarcinoma'} {'Wildtype' } {'Mutant' } {'Wildtype' } {'No' } {'No' } {'No'} {'no' } {'AMC-010'} {'Stanford'} 42 {'Female'} {'Nonsmoker'} {'Adenocarcinoma'} {'Mutant' } {'Wildtype' } {'Wildtype' } {'No' } {'No' } {'No'} {'no' } {'AMC-011'} {'Stanford'} 66 {'Female'} {'Former' } {'Adenocarcinoma'} {'Wildtype' } {'Mutant' } {'Wildtype' } {'Yes'} {'Yes'} {'No'} {'yes'} {'AMC-012'} {'Stanford'} 70 {'Female'} {'Nonsmoker'} {'Adenocarcinoma'} {'Mutant' } {'Wildtype' } {'Wildtype' } {'No' } {'No' } {'No'} {'yes'} {'AMC-013'} {'Stanford'} 67 {'Female'} {'Nonsmoker'} {'Adenocarcinoma'} {'Mutant' } {'Wildtype' } {'Wildtype' } {'No' } {'No' } {'No'} {'no' } {'AMC-014'} {'Stanford'} 78 {'Female'} {'Former' } {'Adenocarcinoma'} {'Wildtype' } {'Wildtype' } {'Wildtype' } {'No' } {'No' } {'No'} {'no' } {'AMC-015'} {'Stanford'} 58 {'Male' } {'Former' } {'Adenocarcinoma'} {'Wildtype' } {'Mutant' } {'Not collected'} {'No' } {'No' } {'No'} {'no' } {'AMC-016'} {'Stanford'} 65 {'Male' } {'Former' } {'Adenocarcinoma'} {'Wildtype' } {'Wildtype' } {'Wildtype' } {'No' } {'No' } {'No'} {'no' }
t_mutant_smokers = t(strcmp(t{:,'KRAS mutation status'},'Mutant') & strcmp(t{:,'Smoking status'},'Current'),:)
t_mutant_smokers = 8×13 table
Case ID Patient affiliation Age at Histological Diagnosis Gender Smoking status Histology EGFR mutation status KRAS mutation status ALK translocation status Adjuvant Treatment Chemotherapy Radiation Recurrence ___________ ___________________ _____________________________ __________ ______________ __________________ ____________________ ____________________ ________________________ __________________ ____________ _________ __________ {'R01-003'} {'VA' } 65 {'Male' } {'Current'} {'Adenocarcinoma'} {'Mutant' } {'Mutant'} {'Wildtype'} {'No' } {'No' } {'No' } {'no' } {'R01-024'} {'VA' } 52 {'Male' } {'Current'} {'Adenocarcinoma'} {'Unknown' } {'Mutant'} {'Unknown' } {'No' } {'No' } {'No' } {'yes'} {'R01-053'} {'VA' } 62 {'Male' } {'Current'} {'Adenocarcinoma'} {'Wildtype'} {'Mutant'} {'Wildtype'} {'No' } {'No' } {'No' } {'no' } {'R01-054'} {'VA' } 56 {'Male' } {'Current'} {'Adenocarcinoma'} {'Wildtype'} {'Mutant'} {'Wildtype'} {'Yes'} {'Yes'} {'Yes'} {'yes'} {'R01-095'} {'VA' } 74 {'Male' } {'Current'} {'Adenocarcinoma'} {'Wildtype'} {'Mutant'} {'Wildtype'} {'No' } {'No' } {'No' } {'no' } {'R01-097'} {'VA' } 70 {'Male' } {'Current'} {'Adenocarcinoma'} {'Wildtype'} {'Mutant'} {'Wildtype'} {'No' } {'No' } {'No' } {'no' } {'R01-116'} {'VA' } 54 {'Male' } {'Current'} {'Adenocarcinoma'} {'Wildtype'} {'Mutant'} {'Wildtype'} {'No' } {'No' } {'No' } {'no' } {'R01-137'} {'Stanford'} 50 {'Female'} {'Current'} {'Adenocarcinoma'} {'Wildtype'} {'Mutant'} {'Wildtype'} {'No' } {'No' } {'No' } {'no' }

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Hypothesis Tests 的更多信息

标签

产品


版本

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by