0% found this document useful (0 votes)
17 views2 pages

R Lab Test: Data Analysis & Regression

Uploaded by

9
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views2 pages

R Lab Test: Data Analysis & Regression

Uploaded by

9
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

AQ077-3-2-PSMOD Lab Test Page 1 of 2

Answer ALL questions.

Before you begin answering the questions, you are required to install 1 package by using the
following:
[Link](“moments”)
library(“moments”)

The questions below are based on the given dataset in CSV format, TestQ1_Q2_Data.csv.
Answer all the questions by using R programming language whenever necessary. Show the
main R code used and display the R results, in each relevant part of the questions.

QUESTION 1 (25 marks)

A graphical analysis was performed to investigate the characteristics of v1, v2, v3, v4 and w
variables.

(a) (i) Construct a histogram by using v1.


(2 marks)
(ii) Referring to the histogram in (a)(i), briefly describe v1’s shape of distribution.
(2 marks)
(b) (i) Construct a boxplot by using w.
(2 marks)
(ii) Referring to the boxplot in (b)(i), briefly describe w’s shape of distribution.
(2 marks)
(c) (i) By using an appropriate function of R, find the Minimum, Q1, Median, Q3 and
Q4 of v3.
(4 marks)
(ii) In conjunction with the values found in (c)(i), interpret the meaning of Q1,
Median, Q3 and Q4
(4 marks)
(iii) Find the skewness of v3, by using an R function.
(2 marks)
(d) (i) Construct a scatterplot by using v1 versus v2.
(2 marks)
(ii) Comment on the correlation between v1 and v2 by just evaluating the scatterplot
in (d) (i). Justify your comment.
(3 marks)
(iii) Find the coefficient of correlation between v1 and v2.
(2 marks)

Level 2 Asia Pacific University of Technology & Innovation YYYY


AQ077-3-2-PSMOD Lab Test Page 2 of 2

QUESTION 2 (25 marks)

A research was carried out to investigate the relationships among v1,v2, v3, v4 and w variables.

(a) (i) Construct a scatterplot matrix by using v3, v4 and w simultaneously.


(2 marks)
(ii) From the results in (a)(i), write down the pair which has the highest correlation.
Justify your answer.
(2 marks)
(b) (i) Build a linear regression model using v4 as independent variable and w as
dependent variable. Name the model as A.
(2 marks)
(ii) Write down the regression equation obtained in (b)(i) in the form:
w = a + bv4
(1 marks)
(iii) Interpret the meaning of a and b in the (b)(ii) regression equation.
(4 marks)
(iv) Write down the value of R2. Interpret its meaning.
(2 marks)
(v) To test whether v4 significantly affects w, H0 and H1 are used. State H0 and H1
respectively.
(2 marks)
(vi) State the conclusion of the above hypothesis testing. Justify your answer.
(2 marks)
(c) By using appropriate R functions, estimate the value of w when v4 = 8.
(4 marks)
(d) (i) Construct a scatterplot between v4 and w, using w for the vertical axis.
(2 marks)
(ii) Fit a linear regression line into the scatterplot in (d)(i).
(2 marks)

Level 2 Asia Pacific University of Technology & Innovation YYYY

You might also like