0% found this document useful (0 votes)
42 views

R Programing

The document describes a statistical analysis of data from an experiment involving ratings of various cheese samples. Several regression models are fit to examine relationships between taste ratings and concentrations of compounds in the cheese. Key findings include: 1) Hydrogen sulfide concentration was significantly positively correlated with taste in all models; 2) Lactic acid concentration was also positively correlated with taste in some models; 3) There was no significant difference in mean taste ratings between different panels of raters.

Uploaded by

usama iqbal
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views

R Programing

The document describes a statistical analysis of data from an experiment involving ratings of various cheese samples. Several regression models are fit to examine relationships between taste ratings and concentrations of compounds in the cheese. Key findings include: 1) Hydrogen sulfide concentration was significantly positively correlated with taste in all models; 2) Lactic acid concentration was also positively correlated with taste in some models; 3) There was no significant difference in mean taste ratings between different panels of raters.

Uploaded by

usama iqbal
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 18

Table 10.

13
Table 10.13 gives data on imports, GDP and the Consumer Price
Index (CPI) for the United States over the period 1975-2005.
You are asked to consider the following model:

Solution:
Model:
In Importst = β1 + β2 In GDPt + β3 In CPIt
Assumption
Normality
H0 = The data is normal
H1 = The data is not normal
Level of Significance
α = 0.05
Solution:
Step 1:

Step 2
Step 3
Results:
Tests of Normality

Kolmogorov-Smirnova Shapiro-Wilk

Statistic df Sig. Statistic df Sig.

Imports .161 31 .039 .910 31 .013

a. Lilliefors Significance Correction

Conclusion: When we apply Kolmogorov-Smirnov test to


check normality it shows that the data is not Normal.

Homoscedastic:
H0 = All variances are Equal
H1 = All variances are not equal
Level of Significance
α = 0.05
Step 1

Step 2
Step 3
Results:
KMO and Bartlett's Test

Kaiser-Meyer-Olkin Measure of Sampling Adequacy. .529


Approx. Chi-Square 222.488

Bartlett's Test of Sphericity df 3

Sig. .000

Regression Model:
Step 1:

Step 2:
Step 3:
Results:
Coefficientsa

Model Unstandardized Coefficients Standardized t Sig.


Coefficients

B Std. Error Beta

(Constant) 159393.456 48889.905 3.260 .003


1 CPI -7444.520 960.510 -.731 -7.751 .000

GDP 230.395 12.771 1.702 18.040 .000

Y = 159393.456 - 7444.520CPI + 230.395GDP


Interpretation:
One unit increase in CPI the response 7444.520 on the average
decrease keeping the other effect constant.
One unit increase in GDP the response 230.395 on the average increase
keeping the other effect constant.
Table 10.18
As cheese ages, several chemical processes take place that
determine the taste of the final product. The data given in Table
10.18 pertain to concentrations of various taste for each sample.
The variables acetic and H2S are the natural logarithm of
concentration of acetic acid and hydrogen sulfide, respectively.
The variable lactic has not been log-transformed.
a. Draw a scatter plot of the four variables.
b. Perform a bivariate regression of taste on acetic and H2S
and interpret your results.
c. Perform a bivariate regression of taste on lactic and H2S,
and interpret the results.
d. Perform a multiple regression of taste on acetic, H2S, and
lactic. Interpret your results.
e. What overall conclusions can you draw from your analysis?

Draw a scatter plot of the four variables


i. Scatter Plot for Taste, Acetic, H2S
Step 1

Step 2
Step 3:
Results

ii. Scatter Plot for Taste, Acetic and Lactic


Step 2
Step 3
Results

iii. Scatter Plot for Acetic, H2S and Lactic


Step 2
Step 3
Results

Perform a bivariate regression of taste on acetic and H2S and interpret


your results.

Step 1
Step 2

Step 3

Results:
Coefficientsa

Model Unstandardized Coefficients Standardized t Sig.


Coefficients

B Std. Error Beta

(Constant) -25.392 16.425 -1.546 .134

1 Acetic 3.213 3.132 .132 1.026 .314

H2S 5.477 .987 .717 5.549 .000

Interpretation
One unit increase in Acetic the response 3.213 on the average increase
keeping the other effect constant.
One unit increase in H2S the response 5.477 on the average increase
keeping the other effect constant.

Perform a bivariate regression of taste on lactic and H2S,


and interpret the results.
Step 1

Step 2
Step 3
Results
Coefficientsa

Model Unstandardized Coefficients Standardized t Sig.


Coefficients

B Std. Error Beta

(Constant) -28.177 8.935 -3.154 .004

1 H2S 3.840 1.134 .503 3.387 .002

Lactic 20.701 7.932 .387 2.610 .015

Interpretation
One unit increase in H2S the response 3.840 on the average increase
keeping the other effect constant.
One unit increase in Lactic the response 20.701 on the average increase
keeping the other effect constant.

Perform a multiple regression of taste on acetic, H2S, and


lactic. Interpret your results.
Step 1
Step 2

Step 3
Results

Coefficientsa

Model Unstandardized Coefficients Standardized t Sig.


Coefficients

B Std. Error Beta

(Constant) -34.358 15.642 -2.197 .037

Acetic 1.449 2.988 .060 .485 .632


1
H2S 3.809 1.152 .498 3.307 .003

Lactic 19.698 8.308 .368 2.371 .025

Interpretation
One unit increase in Acetic the response 1.449 on the average increase
keeping the other effect constant.
One unit increase in H2S the response 3.809 on the average increase
keeping the other effect constant.
One unit increase in Lactic the response 19.698 on the average increase
keeping the other effect constant.

Table 8.6
Anova
H0 = all the panel ranking is same
H1 = all panel ranking is not equal
Level of significance
α = 0.05

Step 1:
Step 2:

Step 3
Results

Tests of Between-Subjects Effects

Dependent Variable: Response

Source Type III Sum of df Mean Square F Sig.


Squares

Corrected Model 1325.238a 19 69.749 11.601 .000

Intercept 5763.013 1 5763.013 958.505 .000

Runs 1325.188 15 88.346 14.694 .000

PanelRanking .050 4 .013 .002 1.000

Error 360.750 60 6.013

Total 7449.000 80

Corrected Total 1685.988 79

a. R Squared = .786 (Adjusted R Squared = .718)


We can say that our all panel ranking mean are Statistically
insignificant so we accept our null hypothesis.
Assumption
Normality
Tests of Normality

PanelRanking Kolmogorov-Smirnova Shapiro-Wilk

Statistic df Sig. Statistic df Sig.

HPN .081 16 .200* .963 16 .712

JPN .090 16 .200* .949 16 .474

Response CAL .081 16 .200* .963 16 .712

DCM .081 16 .200* .963 16 .712

RGB .081 16 .200* .963 16 .712

Interpretation:
Our p value is greater than 0.05 so we can say that our data
follows normal distribution.

Variance Checking
Test of Homogeneity of Variance

Levene Statistic df1 df2 Sig.

Based on Mean .002 4 75 1.000

Based on Median .002 4 75 1.000

Response Based on Median and with .002 4 74.936 1.000

adjusted df

Based on trimmed mean .002 4 75 1.000

Interpretation:
Our p valuer is greater than 0.05 so all the variances are same.

You might also like