Mathematical modeling 2012A Part solution based on R language

Source: Internet
Author: User

1 Library (xlsx)2 Library (nortest)3 Library (Kendall)4 Library (stats)5 6Chart1 <-read.xlsx ("e:/Thunder Download/cumcm2012problems/a/accessories 1-Wine tasting rating table. xls", stringsasfactors = False,sheetindex =1, Header = F,encoding ="UTF-8")7Chart2 <-read.xlsx ("e:/Thunder Download/cumcm2012problems/a/accessories 1-Wine tasting rating table. xls", stringsasfactors = False,sheetindex =2, Header = F,encoding ="UTF-8")8Chart3 <-read.xlsx ("e:/Thunder Download/cumcm2012problems/a/accessories 1-Wine tasting rating table. xls", stringsasfactors = False,sheetindex =3, Header = F,encoding ="UTF-8")9Chart4 <-read.xlsx ("e:/Thunder Download/cumcm2012problems/a/accessories 1-Wine tasting rating table. xls", stringsasfactors = False,sheetindex =4, Header = F,encoding ="UTF-8")TenClassfydata <-read.xlsx ("e:/Thunder Download/cumcm2012problems/a/Annex 2-Indicator summary table. xls", stringsasfactors = False,sheetindex =2, Header = F,encoding ="UTF-8") One  AChart1 <-chart1[-1,-C (1,2, -, -)] -Chart1 <-na.omit (Chart1) -Chart3 <-chart3[-1,-C (1,2)] theChart3 <-na.omit (CHART3) -Chart2 <-Chart2[-c (1,2),-C (1,2,3, -)] -Chart2 <-na.omit (CHART2) -Chart4 <-Chart4[-c (1,2),-C (1:4)] +Chart4 <-na.omit (CHART4) -Chart4 <-chart4[-281,] +  AChart1mean <-Array (, -) atChart2mean <-Array (, -) -Chart3mean <-Array (, -) -Chart4mean <-Array (, -) -Temp <-Array (,Ten) -  -  for(Iinch 1: -){ in    for(hinch 1:Ten){ -TEMP[H] <- as. Numeric (chart1[ A*I,h]) to   } +Chart1mean[i] <-mean (temp) - } the qqnorm (Chart1mean) *  $  for(Iinch 1: -){Panax Notoginseng    for(hinch 1:Ten){ -TEMP[H] <- as. Numeric (chart3[ A*I,h]) the   } +Chart3mean[i] <-mean (temp) A } the qqnorm (Chart3mean) +  -  for(Iinch 1: -){ $    for(hinch 1:Ten){ $TEMP[H] <- as. Numeric (chart2[Ten*I,h]) -   } -Chart2mean[i] <-mean (temp) the } - qqnorm (Chart2mean)Wuyi  the  for(Iinch 1: -){ -    for(hinch 1:Ten){ WuTEMP[H] <- as. Numeric (chart4[Ten*I,h]) -   } AboutChart4mean[i] <-mean (temp) $ } - qqnorm (Chart4mean) -  - shapiro.test (Chart1mean) A shapiro.test (Chart2mean) + shapiro.test (Chart3mean) the shapiro.test (Chart4mean) -  $ lillie.test (Chart1mean) the lillie.test (Chart2mean) the lillie.test (Chart3mean) the lillie.test (Chart4mean) the  -Wilcox.test (chart1mean,chart3mean,exact = False,correct =FALSE) inWilcox.test (chart1mean,chart4mean,exact = False,correct =FALSE) the  the Mannkendall (Chart1mean) About Mannkendall (Chart2mean) the Mannkendall (Chart3mean) the Mannkendall (Chart4mean) the  +Classfydata <-Classfydata[-c (1,2)] -Classfydata <-Classfydata[-c (1,2),] theClassfydata1 <-Classfydata[c (1: -), C (1: to)]BayiClassfydata1 <-Classfydata1[-c (4,5,9, -, -, at, -)] the  the  for(Iinch 1: -){ -    for(hinch 1: -){ -CLASSFYDATA1[I,H] <- as. Numeric (classfydata1[i,h]) the   } the } thez =0; they =0; -  for(jinch 1:4){ thez = J *3-2 they = z +2 the    for(Iinch 1: -){94temp =0 the      for(hinchz:y) { theTemp = temp + as. Numeric (classfydata1[i,h]) the     }98CLASSFYDATA1[I,Z] <-Temp/3 About   } - }101 102  for(Iinch 1: -){103temp =0104    for(hinch  -: -){ theTemp = temp + as. Numeric (classfydata1[i,h])106   }107Classfydata1[i, -] <-temp/3108 }109  theClassfydata1 <-Classfydata1[-c (2,3,5,6,8,9, +, -)]111  theTemp <-classfydata[1: -, +]113Classfydata1 <-Cbind (classfydata1,temp) the  theb =Chart1mean thec = Array (, -)117B1 = C ( -, -,7,Ten, One, -, -, -, +, -,6,4, -, at, -,1,2,3,8, A,5, at, the, -,9, +, -)118  for(Iinch 1: -)119 { -C[b1[i]] =B[i]121 }122Classfydata1 <-Cbind (classfydata1,c)123 classfydata1124  theClassfydata1 <- as. Matrix (CLASSFYDATA1)126Classfydata1 <- as. Data.frame (classfydata1)127  -MC <-Kmeans (classfydata1[- -],4)129Mc$cluster

Mathematical modeling 2012A Part solution based on R language

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.