best fit curve using linear regression

3 views (last 30 days)
Hello,
Iam Pushkar and we are doing research on multiple linear regression wherein we have to train and test a model.
we are trying to predict the compressive strength of cement using 8 variables like air content, water content fly ash etc. so we have 8 x variables and we are predicting y(compressive strength). Since we are new to MATLAB could i please get help on how to go about this. for data please refer to this excel file cement data.
  2 Comments
Star Strider
Star Strider on 7 Feb 2022
My impression is the this is a stepwise multiple llinear regression problem. If so, the stepwisefit function is likely appropriate. If that is not the desires approach, the fitlm function (or one of its friends) could be appropriate.
The file format is causing problems —
T1 = readtable('https://docs.google.com/spreadsheets/d/1BgA99g-YV3j5QrI7td0GCjHjuNx-sY5F/edit#gid=1476261111', 'VariableNamingRule','preserve')
Warning: Table variable names were truncated to the length namelengthmax. The original names are saved in the VariableDescriptions property.
T1 = 207×2334 table <!DOCTYPE html><html lang="en-IE"><head><script nonce="jhm3MBwl Var2 Var3 Var4 Var5 Var6 Var7 Var8 Var9 Var10 Var11 Var12 Var13 Var14 Var15 Var16 Var17 Var18 Var19 Var20 Var21 Var22 Var23 Var24 Var25 Var26 Var27 Var28 Var29 Var30 Var31 Var32 Var33 Var34 Var35 Var36 Var37 Var38 Var39 Var40 Var41 Var42 Var43 Var44 Var45 Var46 Var47 Var48 Var49 Var50 Var51 Var52 Var53 Var54 Var55 Var56 Var57 Var58 Var59 Var60 Var61 Var62 Var63 Var64 Var65 Var66 Var67 Var68 Var69 Var70 Var71 Var72 Var73 Var74 Var75 Var76 Var77 Var78 Var79 Var80 Var81 Var82 Var83 Var84 Var85 Var86 Var87 Var88 Var89 Var90 Var91 Var92 Var93 Var94 Var95 Var96 Var97 Var98 Var99 Var100 Var101 Var102 Var103 Var104 Var105 Var106 Var107 Var108 Var109 Var110 Var111 Var112 Var113 Var114 Var115 Var116 Var117 Var118 Var119 Var120 Var121 Var122 Var123 Var124 Var125 Var126 Var127 Var128 Var129 Var130 Var131 Var132 Var133 Var134 Var135 Var136 Var137 Var138 Var139 Var140 Var141 Var142 Var143 Var144 Var145 Var146 Var147 Var148 Var149 Var150 Var151 Var152 Var153 Var154 Var155 Var156 Var157 Var158 Var159 Var160 Var161 Var162 Var163 Var164 Var165 Var166 Var167 Var168 Var169 Var170 Var171 Var172 Var173 Var174 Var175 Var176 Var177 Var178 Var179 Var180 Var181 Var182 Var183 Var184 Var185 Var186 Var187 Var188 Var189 Var190 Var191 Var192 Var193 Var194 Var195 Var196 Var197 Var198 Var199 Var200 Var201 Var202 Var203 Var204 Var205 Var206 Var207 Var208 Var209 Var210 Var211 Var212 Var213 Var214 Var215 Var216 Var217 Var218 Var219 Var220 Var221 Var222 Var223 Var224 Var225 Var226 Var227 Var228 Var229 Var230 Var231 Var232 Var233 Var234 Var235 Var236 Var237 Var238 Var239 Var240 Var241 Var242 Var243 Var244 Var245 Var246 Var247 Var248 Var249 Var250 Var251 Var252 Var253 Var254 Var255 Var256 Var257 Var258 Var259 Var260 Var261 Var262 Var263 Var264 Var265 Var266 Var267 Var268 Var269 Var270 Var271 Var272 Var273 Var274 Var275 Var276 Var277 Var278 Var279 Var280 Var281 Var282 Var283 Var284 Var285 Var286 Var287 Var288 Var289 Var290 Var291 Var292 Var293 Var294 Var295 Var296 Var297 Var298 Var299 Var300 Var301 Var302 Var303 Var304 Var305 Var306 Var307 Var308 Var309 Var310 Var311 Var312 Var313 Var314 Var315 Var316 Var317 Var318 Var319 Var320 Var321 Var322 Var323 Var324 Var325 Var326 Var327 Var328 Var329 Var330 Var331 Var332 Var333 Var334 Var335 Var336 Var337 Var338 Var339 Var340 Var341 Var342 Var343 Var344 Var345 Var346 Var347 Var348 Var349 Var350 Var351 Var352 Var353 Var354 Var355 Var356 Var357 Var358 Var359 Var360 Var361 Var362 Var363 Var364 Var365 Var366 Var367 Var368 Var369 Var370 Var371 Var372 Var373 Var374 Var375 Var376 Var377 Var378 Var379 Var380 Var381 Var382 Var383 Var384 Var385 Var386 Var387 Var388 Var389 Var390 Var391 Var392 Var393 Var394 Var395 Var396 Var397 Var398 Var399 Var400 Var401 Var402 Var403 Var404 Var405 Var406 Var407 Var408 Var409 Var410 Var411 Var412 Var413 Var414 Var415 Var416 Var417 Var418 Var419 Var420 Var421 Var422 Var423 Var424 Var425 Var426 Var427 Var428 Var429 Var430 Var431 Var432 Var433 Var434 Var435 Var436 Var437 Var438 Var439 Var440 Var441 Var442 Var443 Var444 Var445 Var446 Var447 Var448 Var449 Var450 Var451 Var452 Var453 Var454 Var455 Var456 Var457 Var458 Var459 Var460 Var461 Var462 Var463 Var464 Var465 Var466 Var467 Var468 Var469 Var470 Var471 Var472 Var473 Var474 Var475 Var476 Var477 Var478 Var479 Var480 Var481 Var482 Var483 Var484 Var485 Var486 Var487 Var488 Var489 Var490 Var491 Var492 Var493 Var494 Var495 Var496 Var497 Var498 Var499 Var500 Var501 Var502 Var503 Var504 Var505 Var506 Var507 Var508 Var509 Var510 Var511 Var512 Var513 Var514 Var515 Var516 Var517 Var518 Var519 Var520 Var521 Var522 Var523 Var524 Var525 Var526 Var527 Var528 Var529 Var530 Var531 Var532 Var533 Var534 Var535 Var536 Var537 Var538 Var539 Var540 Var541 Var542 Var543 Var544 Var545 Var546 Var547 Var548 Var549 Var550 Var551 Var552 Var553 Var554 Var555 Var556 Var557 Var558 Var559 Var560 Var561 Var562 Var563 Var564 Var565 Var566 Var567 Var568 Var569 Var570 Var571 Var572 Var573 Var574 Var575 Var576 Var577 Var578 Var579 Var580 Var581 Var582 Var583 Var584 Var585 Var586 Var587 Var588 Var589 Var590 Var591 Var592 Var593 Var594 Var595 Var596 Var597 Var598 Var599 Var600 Var601 Var602 Var603 Var604 Var605 Var606 Var607 Var608 Var609 Var610 Var611 Var612 Var613 Var614 Var615 Var616 Var617 Var618 Var619 Var620 Var621 Var622 Var623 Var624 Var625 Var626 Var627 Var628 Var629 Var630 Var631 Var632 Var633 Var634 Var635 Var636 Var637 Var638 Var639 Var640 Var641 Var642 Var643 Var644 Var645 Var646 Var647 Var648 Var649 Var650 Var651 Var652 Var653 Var654 Var655 Var656 Var657 Var658 Var659 Var660 Var661 Var662 Var663 Var664 Var665 Var666 Var667 Var668 Var669 Var670 Var671 Var672 Var673 Var674 Var675 Var676 Var677 Var678 Var679 Var680 Var681 Var682 Var683 Var684 Var685 Var686 Var687 Var688 Var689 Var690 Var691 Var692 Var693 Var694 Var695 Var696 Var697 Var698 Var699 Var700 Var701 Var702 Var703 Var704 Var705 Var706 Var707 Var708 Var709 Var710 Var711 Var712 Var713 Var714 Var715 Var716 Var717 Var718 Var719 Var720 Var721 Var722 Var723 Var724 Var725 Var726 Var727 Var728 Var729 Var730 Var731 Var732 Var733 Var734 Var735 Var736 Var737 Var738 Var739 Var740 Var741 Var742 Var743 Var744 Var745 Var746 Var747 Var748 Var749 Var750 Var751 Var752 Var753 Var754 Var755 Var756 Var757 Var758 Var759 Var760 Var761 Var762 Var763 Var764 Var765 Var766 Var767 Var768 Var769 Var770 Var771 Var772 Var773 Var774 Var775 Var776 Var777 Var778 Var779 Var780 Var781 Var782 Var783 Var784 Var785 Var786 Var787 Var788 Var789 Var790 Var791 Var792 Var793 Var794 Var795 Var796 Var797 Var798 Var799 Var800 Var801 Var802 Var803 Var804 Var805 Var806 Var807 Var808 Var809 Var810 Var811 Var812 Var813 Var814 Var815 Var816 Var817 Var818 Var819 Var820 Var821 Var822 Var823 Var824 Var825 Var826 Var827 Var828 Var829 Var830 Var831 Var832 Var833 Var834 Var835 Var836 Var837 Var838 Var839 Var840 Var841 Var842 Var843 Var844 Var845 Var846 Var847 Var848 Var849 Var850 Var851 Var852 Var853 Var854 Var855 Var856 Var857 Var858 Var859 Var860 Var861 Var862 Var863 Var864 Var865 Var866 Var867 Var868 Var869 Var870 Var871 Var872 Var873 Var874 Var875 Var876 Var877 Var878 Var879 Var880 Var881 Var882 Var883 Var884 Var885 Var886 Var887 Var888 Var889 Var890 Var891 Var892 Var893 Var894 Var895 Var896 Var897 Var898 Var899 Var900 Var901 Var902 Var903 Var904 Var905 Var906 Var907 Var908 Var909 Var910 Var911 Var912 Var913 Var914 Var915 Var916 Var917 Var918 Var919 Var920 Var921 Var922 Var923 Var924 Var925 Var926 Var927 Var928 Var929 Var930 Var931 Var932 Var933 Var934 Var935 Var936 Var937 Var938 Var939 Var940 Var941 Var942 Var943 Var944 Var945 Var946 Var947 Var948 Var949 Var950 Var951 Var952 Var953 Var954 Var955 Var956 Var957 Var958 Var959 Var960 Var961 Var962 Var963 Var964 Var965 Var966 Var967 Var968 Var969 Var970 Var971 Var972 Var973 Var974 Var975 Var976 Var977 Var978 Var979 Var980 Var981 Var982 Var983 Var984 Var985 Var986 Var987 Var988 Var989 Var990 Var991 Var992 Var993 Var994 Var995 Var996 Var997 Var998 Var999 Var1000 Var1001 Var1002 Var1003 Var1004 Var1005 Var1006 Var1007 Var1008 Var1009 Var1010 Var1011 Var1012 Var1013 Var1014 Var1015 Var1016 Var1017 Var1018 Var1019 Var1020 Var1021 Var1022 Var1023 Var1024 Var1025 Var1026 Var1027 Var1028 Var1029 Var1030 Var1031 Var1032 Var1033 Var1034 Var1035 Var1036 Var1037 Var1038 Var1039 Var1040 Var1041 Var1042 Var1043 Var1044 Var1045 Var1046 Var1047 Var1048 Var1049 Var1050 Var1051 Var1052 Var1053 Var1054 Var1055 Var1056 Var1057 Var1058 Var1059 Var1060 Var1061 Var1062 Var1063 Var1064 Var1065 Var1066 Var1067 Var1068 Var1069 Var1070 Var1071 Var1072 Var1073 Var1074 Var1075 Var1076 Var1077 Var1078 Var1079 Var1080 Var1081 Var1082 Var1083 Var1084 Var1085 Var1086 Var1087 Var1088 Var1089 Var1090 Var1091 Var1092 Var1093 Var1094 Var1095 Var1096 Var1097 Var1098 Var1099 Var1100 Var1101 Var1102 Var1103 Var1104 Var1105 Var1106 Var1107 Var1108 Var1109 Var1110 Var1111 Var1112 Var1113 Var1114 Var1115 Var1116 Var1117 Var1118 Var1119 Var1120 Var1121 Var1122 Var1123 Var1124 Var1125 Var1126 Var1127 Var1128 Var1129 Var1130 Var1131 Var1132 Var1133 Var1134 Var1135 Var1136 Var1137 Var1138 Var1139 Var1140 Var1141 Var1142 Var1143 Var1144 Var1145 Var1146 Var1147 Var1148 Var1149 Var1150 Var1151 Var1152 Var1153 Var1154 Var1155 Var1156 Var1157 Var1158 Var1159 Var1160 Var1161 Var1162 Var1163 Var1164 Var1165 Var1166 Var1167 Var1168 Var1169 Var1170 Var1171 Var1172 Var1173 Var1174 Var1175 Var1176 Var1177 Var1178 Var1179 Var1180 Var1181 Var1182 Var1183 Var1184 Var1185 Var1186 Var1187 Var1188 Var1189 Var1190 Var1191 Var1192 Var1193 Var1194 Var1195 Var1196 Var1197 Var1198 Var1199 Var1200 Var1201 Var1202 Var1203 Var1204 Var1205 Var1206 Var1207 Var1208 Var1209 Var1210 Var1211 Var1212 Var1213 Var1214 Var1215 Var1216 Var1217 Var1218 Var1219 Var1220 Var1221 Var1222 Var1223 Var1224 Var1225 Var1226 Var1227 Var1228 Var1229 Var1230 Var1231 Var1232 Var1233 Var1234 Var1235 Var1236 Var1237 Var1238 Var1239 Var1240 Var1241 Var1242 Var1243 Var1244 Var1245 Var1246 Var1247 Var1248 Var1249 Var1250 Var1251 Var1252 Var1253 Var1254 Var1255 Var1256 Var1257 Var1258 Var1259 Var1260 Var1261 Var1262 Var1263 Var1264 Var1265 Var1266 Var1267 Var1268 Var1269 Var1270 Var1271 Var1272 Var1273 Var1274 Var1275 Var1276 Var1277 Var1278 Var1279 Var1280 Var1281 Var1282 Var1283 Var1284 Var1285 Var1286 Var1287 Var1288 Var1289 Var1290 Var1291 Var1292 Var1293 Var1294 Var1295 Var1296 Var1297 Var1298 Var1299 Var1300 Var1301 Var1302 Var1303 Var1304 Var1305 Var1306 Var1307 Var1308 Var1309 Var1310 Var1311 Var1312 Var1313 Var1314 Var1315 Var1316 Var1317 Var1318 Var1319 Var1320 Var1321 Var1322 Var1323 Var1324 Var1325 Var1326 Var1327 Var1328 Var1329 Var1330 Var1331 Var1332 Var1333 Var1334 Var1335 Var1336 Var1337 Var1338 Var1339 Var1340 Var1341 Var1342 Var1343 Var1344 Var1345 Var1346 Var1347 Var1348 Var1349 Var1350 Var1351 Var1352 Var1353 Var1354 Var1355 Var1356 Var1357 Var1358 Var1359 Var1360 Var1361 Var1362 Var1363 Var1364 Var1365 Var1366 Var1367 Var1368 Var1369 Var1370 Var1371 Var1372 Var1373 Var1374 Var1375 Var1376 Var1377 Var1378 Var1379 Var1380 Var1381 Var1382 Var1383 Var1384 Var1385 Var1386 Var1387 Var1388 Var1389 Var1390 Var1391 Var1392 Var1393 Var1394 Var1395 Var1396 Var1397 Var1398 Var1399 Var1400 Var1401 Var1402 Var1403 Var1404 Var1405 Var1406 Var1407 Var1408 Var1409 Var1410 Var1411 Var1412 Var1413 Var1414 Var1415 Var1416 Var1417 Var1418 Var1419...
First10Rows = T1(1:10,1:9)
First10Rows = 10×9 table
<!DOCTYPE html><html lang="en-IE"><head><script nonce="jhm3MBwl Var2 Var3 Var4 Var5 Var6 Var7 Var8 Var9 ____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ ______________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ ______________________________________________ _________________________________________________________________________________________________________________________________________________________________________________________________________ ____________________________________________________________________________________________________________________________________________________ _____________________________________________________________________________________________________________________________________________________________ _______________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ ___________________________________________________________ ______________________________________________________________________________________________ {'Cement (component 1)(kg in a m^3 mixture)' } {'Blast Furnace Slag (component 2)(kg in a m^3 mixture)' } {'Fly Ash (component 3)(kg in a m^3 mixture)'} {'Water (component 4)(kg in a m^3 mixture)' } {'Superplasticizer (component 5)(kg in a m^3 mixture)' } {'Coarse Aggregate (component 6)(kg in a m^3 mixture)' } {'Fin..."><meta name="google" content="notranslate"><meta http-equiv="X-UA-Compatible" content="IE=edge;"><meta name="referrer" content="origin"><title>Concrete_Data.xls - Google Sheets</title><link rel="shortcut icon" href="//ssl.gstatic.com/docs/spreadsheets/favicon3.ico"><link rel="chrome-webstore-item" href="https://chrome.google.com/webstore/detail/apdfllckaahabafndbhieahigkjlhalf"><script nonce="jhm3MBwlO2KLCuP1xh2wMA">_docs_webfonts_fontFaces = null; _docs_webfonts_iframe_fontFaces = null;DOCS_timing['wpid']=new Date().getTime();</script><style nonce="MIwdqrHEvnM5NEgCaXci5g">.gb_Ua:not(.gb_Ad){font:13px/27px Roboto'} {'RobotoDraft' } {'Arial' } {'try{' } {0×0 char } {0×0 char } {0×0 char } {0×0 char } {0×0 char } {0×0 char } {0×0 char } {0×0 char } {'var ka' } {'sa' } {'ya' } {'za' } {'Ea' } {'Fa' } {'Ga' } {'Ha' } {'Ia' } {'_.ia=function(){return _.p("Safari")&&!(_.fa()||_.p("Coast")||_.ca()||_.p("Edge")||_.p("Edg/")||_.p("OPR")||_.ea()||_.p("Silk")||_.p("Android"))};_.fa=function(){return(_.p("Chrome")||_.p("CriOS"))&&!_.p("Edge")||_.p("Silk")};_.ja=function(){return _.p("Android")&&!(_.fa()||_.ea()||_.ca()||_.p("Silk"))};ka=function(){return _.p("iPhone")&&!_.p("iPod")&&!_.p("iPad")};_.la=function(){return ka()||_.p("iPad")||_.p("iPod")};'} {0×0 char } {0×0 char } {0×0 char } {0×0 char } {0×0 char } {0×0 char } {0×0 char } {0×0 char } {'_.ma=function(a){var b=a.length;if(0<b){for(var c=Array(b)' } {'d=0;d<b;d++)c[d]=a[d];return c}return[]};_.na=function(){return-1!=_.ba().toLowerCase().indexOf("webkit")&&!_.p("Edge")};_.pa=function(a){return _.oa&&null!=a&&a instanceof Uint8Array};_.ra=function(a){Object.isFrozen(a)||(qa?a[qa]|=1:void 0!==a.Od?a.Od|=1:Object.defineProperties(a'} {'{Od:{value:1' } {'configurable:!0' } {'writable:!0' } {'enumerable:!1}}));return a};sa=function(a){return null!==a&&"object"===typeof a&&!Array.isArray(a)&&a.constructor===Object};' } {0×0 char } {0×0 char } {0×0 char } {'_.va=function(a){switch(typeof a){case "number":return isFinite(a)?a:String(a);case "object":if(a&&!Array.isArray(a)){if(_.pa(a))return _.ta(a);if("function"==typeof _.ua&&a instanceof _.ua)return a.o()}}return a};ya=function(a' } {'b){if(null!=a){if(Array.isArray(a))a=_.xa(a' } {'b);else if(sa(a)){var c={}' } {'d;for(d in a)c[d]=ya(a[d]' } {'b);a=c}else a=b(a);return a}};' } {0×0 char } {0×0 char } {0×0 char } {0×0 char } {'_.xa=function(a' } {'b){for(var c=a.slice()' } {'d=0;d<c.length;d++)c[d]=ya(c[d]' } {'b);if(b=Array.isArray(a)){var e;qa?e=a[qa]:e=a.Od;b=(null==e?0:e)&1}b&&_.ra(c);return c};za=function(a){if(a&&"object"==typeof a&&a.toJSON)return a.toJSON();a=_.va(a);return Array.isArray(a)?_.xa(a'} {'za):a};_.r=function(a' } {'b){return null!=a?!!a:!!b};_.t=function(a' } {'b){void 0==b&&(b="");return null!=a?a:b};_.Aa=function(a' } {'b){void 0==b&&(b=0);return null!=a?a:b};_.Ba=function(a'} {'b' } {'_.Da=function(a' } {'b){for(var c' } {'d' } {'e=1;e<arguments.length;e++){d=arguments[e];for(c in d)a[c]=d[c];for(var f=0;f<Ca.length;f++)c=Ca[f]' } {'Object.prototype.hasOwnProperty.call(d' } {'c)&&(a[c]=d[c])}};Ea=function(a){var b=0;return function(){return b<a.length?{done:!1' } {'value:a[b++]}:{done:!0}}};Fa="function"==typeof Object.defineProperties?Object.defineProperty:function(a' } {'b' } {'c){if(a==Array.prototype||a==Object.prototype)return a;a[b]=c.value;return a};' } {'Ga=function(a){a=["object"==typeof globalThis&&globalThis' } {'a' } {'"object"==typeof window&&window' } {'"object"==typeof self&&self' } {'"object"==typeof global&&global];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error("a");};Ha=Ga(this);Ia=function(a'} {'b){if(b)a:{var c=Ha;a=a.split(".");for(var d=0;d<a.length-1;d++){var e=a[d];if(!(e in c))break a;c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&Fa(c'} {'a' } {'{configurable:!0' } {'writable:!0' } {'Ia("Symbol"' } {'function(a){if(a)return a;var b=function(f' } {'g){this.j=f;Fa(this' } {'"description"' } {'{configurable:!0' } {'writable:!0' } {'value:g})};b.prototype.toString=function(){return this.j};var c="jscomp_symbol_"+(1E9*Math.random()>>>0)+"_"' } {'d=0' } {'e=function(f){if(this instanceof e)throw new TypeError("b");return new b(c+(f||"")+"_"+d++'}
Please post the data as an Excel file or some other format that MATLAB can read, and upload it here rather than to some offiste location.
.
Pushkar K
Pushkar K on 7 Feb 2022
Thank you very much have uploaded the file below

Sign in to comment.

Accepted Answer

Star Strider
Star Strider on 7 Feb 2022
Here is the stepwiselm result —
T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/886775/Concrete_Data.xls', 'VariableNamingRule','preserve')
T1 = 1030×9 table
Cement (component 1)(kg in a m^3 mixture) Blast Furnace Slag (component 2)(kg in a m^3 mixture) Fly Ash (component 3)(kg in a m^3 mixture) Water (component 4)(kg in a m^3 mixture) Superplasticizer (component 5)(kg in a m^3 mixture) Coarse Aggregate (component 6)(kg in a m^3 mixture) Fine Aggregate (component 7)(kg in a m^3 mixture) Age (day) Concrete compressive strength(MPa, megapascals) _________________________________________ _____________________________________________________ __________________________________________ _________________________________________ ___________________________________________________ ____________________________________________________ _________________________________________________ _________ _______________________________________________ 540 0 0 162 2.5 1040 676 28 79.986 540 0 0 162 2.5 1055 676 28 61.887 332.5 142.5 0 228 0 932 594 270 40.27 332.5 142.5 0 228 0 932 594 365 41.053 198.6 132.4 0 192 0 978.4 825.5 360 44.296 266 114 0 228 0 932 670 90 47.03 380 95 0 228 0 932 594 365 43.698 380 95 0 228 0 932 594 28 36.448 266 114 0 228 0 932 670 28 45.854 475 0 0 228 0 932 594 28 39.29 198.6 132.4 0 192 0 978.4 825.5 90 38.074 198.6 132.4 0 192 0 978.4 825.5 28 28.022 427.5 47.5 0 228 0 932 594 270 43.013 190 190 0 228 0 932 670 90 42.327 304 76 0 228 0 932 670 28 47.814 380 0 0 228 0 932 670 90 52.908
y = T1{:,9}
y = 1030×1
79.9861 61.8874 40.2695 41.0528 44.2961 47.0298 43.6983 36.4478 45.8543 39.2898
x = T1{:,1:8}
x = 1030×8
1.0e+03 * 0.5400 0 0 0.1620 0.0025 1.0400 0.6760 0.0280 0.5400 0 0 0.1620 0.0025 1.0550 0.6760 0.0280 0.3325 0.1425 0 0.2280 0 0.9320 0.5940 0.2700 0.3325 0.1425 0 0.2280 0 0.9320 0.5940 0.3650 0.1986 0.1324 0 0.1920 0 0.9784 0.8255 0.3600 0.2660 0.1140 0 0.2280 0 0.9320 0.6700 0.0900 0.3800 0.0950 0 0.2280 0 0.9320 0.5940 0.3650 0.3800 0.0950 0 0.2280 0 0.9320 0.5940 0.0280 0.2660 0.1140 0 0.2280 0 0.9320 0.6700 0.0280 0.4750 0 0 0.2280 0 0.9320 0.5940 0.0280
VN = T1.Properties.VariableNames.';
cncrt_mdl = stepwiselm(x,y)
1. Adding x1, FStat = 338.7258, pValue = 1.323458e-65 2. Adding x5, FStat = 163.3824, pValue = 7.963229e-35 3. Adding x8, FStat = 258.4548, pValue = 4.882055e-52 4. Adding x5:x8, FStat = 180.2023, pValue = 5.747721e-38 5. Adding x2, FStat = 203.2321, pValue = 3.374039e-42 6. Adding x3, FStat = 76.0242, pValue = 1.11577e-17 7. Adding x4, FStat = 86.703, pValue = 7.48955e-20 8. Adding x3:x8, FStat = 34.8585, pValue = 4.82205e-09 9. Adding x4:x5, FStat = 31.0144, pValue = 3.27509e-08 10. Adding x2:x8, FStat = 21.0914, pValue = 4.92592e-06 11. Adding x2:x5, FStat = 7.0121, pValue = 0.0082212 12. Adding x4:x8, FStat = 6.1869, pValue = 0.01303 13. Adding x3:x4, FStat = 7.7585, pValue = 0.0054453 14. Adding x3:x5, FStat = 9.9796, pValue = 0.0016297 15. Adding x1:x5, FStat = 7.5392, pValue = 0.0061438 16. Adding x1:x4, FStat = 16.7626, pValue = 4.57345e-05 17. Adding x1:x3, FStat = 10.4966, pValue = 0.00123489 18. Adding x2:x4, FStat = 5.746, pValue = 0.016707 19. Adding x2:x3, FStat = 7.2807, pValue = 0.0070861 20. Adding x1:x2, FStat = 10.6893, pValue = 0.00111396
cncrt_mdl =
Linear regression model: y ~ 1 + x1*x2 + x1*x3 + x1*x4 + x1*x5 + x2*x3 + x2*x4 + x2*x5 + x2*x8 + x3*x4 + x3*x5 + x3*x8 + x4*x5 + x4*x8 + x5*x8 Estimated Coefficients: Estimate SE tStat pValue __________ __________ _______ __________ (Intercept) -113.4 23.132 -4.9023 1.1034e-06 x1 0.39862 0.050343 7.918 6.3387e-15 x2 0.22442 0.062939 3.5657 0.00037987 x3 0.50871 0.085183 5.9719 3.2452e-09 x4 0.53697 0.12077 4.4461 9.7126e-06 x5 1.0107 0.72773 1.3888 0.1652 x8 0.28998 0.057073 5.0809 4.4742e-07 x1:x2 0.00015467 4.7307e-05 3.2695 0.001114 x1:x3 0.00027127 5.8655e-05 4.6248 4.2369e-06 x1:x4 -0.0015362 0.00026385 -5.8222 7.799e-09 x1:x5 -0.0059251 0.0008539 -6.9389 7.0586e-12 x2:x3 0.00035172 8.9039e-05 3.9502 8.3525e-05 x2:x4 -0.0010407 0.00032586 -3.1938 0.0014475 x2:x5 -0.0031075 0.0011175 -2.7809 0.0055222 x2:x8 0.00031091 6.1597e-05 5.0475 5.3084e-07 x3:x4 -0.0028204 0.00044124 -6.392 2.4983e-10 x3:x5 -0.011149 0.0015849 -7.0343 3.6914e-12 x3:x8 0.00095965 0.00015647 6.1333 1.2341e-09 x4:x5 0.0096603 0.0031508 3.066 0.0022273 x4:x8 -0.0010991 0.00028058 -3.9171 9.5641e-05 x5:x8 0.010731 0.0017283 6.209 7.778e-10 Number of observations: 1030, Error degrees of freedom: 1009 Root Mean Squared Error: 8.7 R-squared: 0.734, Adjusted R-Squared: 0.729 F-statistic vs. constant model: 139, p-value = 1.88e-273
[tStatv,sidx] = sort(abs(cncrt_mdl.Coefficients.tStat),'descend');
RankedCoefficients = table(cncrt_mdl.CoefficientNames(sidx)',tStatv)
RankedCoefficients = 21×2 table
Var1 tStatv _______________ ______ {'x1' } 7.918 {'x3:x5' } 7.0343 {'x1:x5' } 6.9389 {'x3:x4' } 6.392 {'x5:x8' } 6.209 {'x3:x8' } 6.1333 {'x3' } 5.9719 {'x1:x4' } 5.8222 {'x8' } 5.0809 {'x2:x8' } 5.0475 {'(Intercept)'} 4.9023 {'x1:x3' } 4.6248 {'x4' } 4.4461 {'x2:x3' } 3.9502 {'x4:x8' } 3.9171 {'x2' } 3.5657
The ‘RankedCoefficients’ table has the coefficient names (as provided to or created by stepwiselm) sorted in order by descending values of the absolute values of the t-statistic (higher values are bettter predictors). See the documentation section on Wilkinson Notation to understand how to interpret these results.
.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!