Please add header the table after importing the data your script
Your assignment will not be assessed if the code is missing, or the outputs of the
code are inconsistent with the slides.
This dataset includes 5 variables, denoted as X1, X2, X3, X4, X5, and Y, described as follows:
X1 - citric acid
X2 - chlorides
X3 - total sulphur dioxide
X4 - pH
X5 - alcohol
Y - quality (score between 0 and 10)Please note, the file "RedWine.txt" has no column names. This is by design. The columns follow the above order. Please add a header to the table after importing the data in your script.
(ii) Assign the data to a matrix, e.g. using
the.data <- as.matrix(read.table("RedWine.txt "))
(iii) The variable of interest is quality (Y). To investigate Y, generate a subset of 500 data, e.g. using:
my.data <- the.data[sample(1:1599,400),c(1:6)]
[The following tasks are based on the 400 sample data]
(iv) Using scatter plots and histograms to understand the relationship between each of the variables X1, X2, X3, X4, X5 and the variable of interest Y.2. Transform the data
| Choose | any | four | from | the | five | variables | (X1, | X2, | ..., | X5). |
|---|
3. Build models and investigate the importance of each variable
(i) Import AggWaFit718.R file to your working directory and load into the R workspace using, source("AggWaFit718.R")
(ii) Evaluating the following fitting functions on the transformed data:
• A weighted arithmetic mean (WAM)
• Weighted power means (WPM) with P=0.5 and P=2
• An ordered weighted averaging function (OWA)4. Use your model for prediction
Using your best fitting model based on Q3, predict the wine quality for the input: X1=1; X2= 0.75; X3=40; X4=3.53; X5=8.3.
- Explain the transformations applied for the selected four variables and the variable of interest.
- Include two tables - one with the error measures and correlation coefficients, and one summarising the weights/parameters and any other useful information learned for your data.- Explain the importance of each of the variables (the four variables that you have selected).- Which fitting function is the best fitting model on your selected data. - Give your prediction result and comment on whether you think it is reasonable.
Submission details
You must correctly use the Harvard style in this assessment. See the .
Academic integrity, plagiarism and collusion
4





