Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 11

ASSIGNMENT NO: 8

Submitted To: Dr. RAMPRRASADH GOARTHY

PGDM 2019-2021

Group No: 09

Name SAP ID
Saurabh Pratap Singh 80203190169
Aditya Yadav 80203190184
Yogeshkumar Shankariya 80203190158
Code by using the Factanal:

CAR

library(psych)

library(GPArotation)

library(factoextra)

install.packages("ggplot2")

setwd("C:\\Users\\Dell\\Desktop\\NMIMS_SEM_4\\DAT&T\\DATT - Class 08 of 20")

Cardata <- read.csv("Car Survey Questionnaire Data.csv", header = T)

colnames(Cardata)[3] <- "Exterior Looks"

colnames(Cardata)[4] <- "Space Comfort"

colnames(Cardata)[6] <- "After Sales Service"

colnames(Cardata)[7] <- "Resale Value"

colnames(Cardata)[8] <- "Fuel Type"

colnames(Cardata)[9] <- "Fuel Efficiency"

colnames(Cardata)[12] <- "Test Drive"

colnames(Cardata)[13] <- "Product Reviews"

head(Cardata)

library(corrplot)

cor(Cardata)

corrplot(cor(Cardata))

fit <- princomp(Cardatadata, cor = T)

screeplot(fit, type = "line", main = "screeplot")

?factanal()

threefactor <- factanal(Cardata, factors = 3, fm = "minres") # varimax is default

print(threefactor, digits=2, cutoff=.4)

fourfactor <- factanal(Cardata, factors = 4, fm = "minres") # varimax is default

print(fourfactor, digits=2, cutoff=.4)

fivefactor <- factanal(Cardata, factors = 5, fm = "minres") # varimax is default

print(fivefactor, digits=2, cutoff=.4)


Dettol-Soup

soupdata <- read.csv("Dettol Soap.csv")

library(psych)

library(GPArotation)

library(factoextra)

summary(soupdata)

library(corrplot)

cor(soupdata)

corrplot(cor(soupdata))

fit <- princomp(soupdata, cor = T)

screeplot(fit, type = "line", main = "screeplot")

threefactor <- factanal(soupdata, factors = 3, fm = "minres") # varimax is default

print(threefactor, digits = 2,cutoff = 0.4)

fa.diagram(threefactor)

fourfactor <- factanal(soupdata, factors = 4, fm = "minres") # varimax is default

print(fourfactor, digits = 2, cutoff = 0.4)

fivefactor <- factanal(soupdata, factors = 5, fm = "minres") # varimax is default

print(fivefactor, digit= 2, cutoff = 0.4)


Output

For Cars :
threefactor <- factanal(Cardata, factors = 3, fm = "minres")
# varimax is default
> print(threefactor, digits=2, cutoff=.4)

Call:
factanal(x = Cardata, factors = 3, fm = "minres")

Uniquenesses:
Price Safety Exterior Looks
Space Comfort Technology
0.72 0.90 0.85
0.28 0.87
After Sales Service Resale Value Fuel Type
Fuel Efficiency Color
0.76 0.31 0.71
0.59 0.26
Maintenance Test Drive Product Reviews
Testimonials
0.57 0.90 0.78
0.85

Loadings:
Factor1 Factor2 Factor3
Price 0.48
Safety
Exterior Looks
Space Comfort 0.80
Technology
After Sales Service 0.47
Resale Value 0.83
Fuel Type 0.52
Fuel Efficiency 0.41
Color 0.85
Maintenance 0.53
Test Drive
Product Reviews
Testimonials

Factor1 Factor2 Factor3


SS loadings 1.84 1.59 1.23
Proportion Var 0.13 0.11 0.09
Cumulative Var 0.13 0.24 0.33

Test of the hypothesis that 3 factors are sufficient.


The chi square statistic is 65.94 on 52 degrees of freedom.
The p-value is 0.0925

Here total variation is just 33% so that it is not very reliable.


fourfactor <- factanal(Cardata, factors = 4, fm = "minres") #
varimax is default
> print(fourfactor, digits=2, cutoff=.4)

Call:
factanal(x = Cardata, factors = 4, fm = "minres")

Uniquenesses:
Price Safety Exterior Looks
Space Comfort Technology
0.71 0.79 0.79
0.29 0.87
After Sales Service Resale Value Fuel Type
Fuel Efficiency Color
0.75 0.39 0.66
0.58 0.10
Maintenance Test Drive Product Reviews
Testimonials
0.55 0.79 0.67
0.51

Loadings:
Factor1 Factor2 Factor3 Factor4
Price 0.52
Safety
Exterior Looks -0.42
Space Comfort 0.79
Technology
After Sales Service 0.44
Resale Value 0.75
Fuel Type 0.57
Fuel Efficiency 0.51
Color 0.89
Maintenance 0.60
Test Drive 0.42
Product Reviews 0.45
Testimonials 0.66

Factor1 Factor2 Factor3 Factor4


SS loadings 1.76 1.52 1.14 1.13
Proportion Var 0.13 0.11 0.08 0.08
Cumulative Var 0.13 0.23 0.32 0.40

Test of the hypothesis that 4 factors are sufficient.


The chi square statistic is 44.58 on 41 degrees of freedom.
The p-value is 0.323
fivefactor <- factanal(Cardata, factors = 5, fm = "minres") #
varimax is default
> print(fivefactor, digits=2, cutoff=.4)

Call:
factanal(x = Cardata, factors = 5, fm = "minres")

Uniquenesses:
Price Safety Exterior Looks
Space Comfort Technology
0.67 0.77 0.81
0.10 0.87
After Sales Service Resale Value Fuel Type
Fuel Efficiency Color
0.00 0.43 0.72
0.53 0.00
Maintenance Test Drive Product Reviews
Testimonials
0.54 0.78 0.65
0.51

Loadings:
Factor1 Factor2 Factor3 Factor4 Factor5
Price 0.56
Safety
Exterior Looks
Space Comfort 0.90
Technology
After Sales Service 0.93
Resale Value 0.70
Fuel Type 0.52
Fuel Efficiency 0.47
Color 0.95
Maintenance 0.61
Test Drive 0.42
Product Reviews 0.44
Testimonials 0.67

Factor1 Factor2 Factor3 Factor4 Factor5


SS loadings 1.70 1.49 1.19 1.12 1.11
Proportion Var 0.12 0.11 0.09 0.08 0.08
Cumulative Var 0.12 0.23 0.31 0.39 0.47

Test of the hypothesis that 5 factors are sufficient.


The chi square statistic is 25.42 on 31 degrees of freedom.
The p-value is 0.749

Here total variation is 0.47 which is better compare to 0.40, which we got from four factor analysis.

Also, from scree plot, we can say that five factors are understanding majority of variation.
For Dettol Soup:

threefactor <- factanal(soupdata, factors = 3, fm = "minres")


> print(threefactor, digits = 2,cutoff = 0.4)

Call:
factanal(x = soupdata, factors = 3, fm = "minres")

Uniquenesses:
V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13
V14 V15
0.69 0.52 0.60 0.80 0.65 0.46 0.71 0.74 0.75 0.00 0.87 0.59 0.66
0.68 0.77

Loadings:
Factor1 Factor2 Factor3
V1 0.50
V2 0.68
V3 0.62
V4 0.43
V5 0.56
V6 0.63
V7 0.45
V8 0.51
V9
V10 0.98
V11
V12 0.62
V13 0.56
V14 0.48
V15

Factor1 Factor2 Factor3


SS loadings 2.28 1.81 1.41
Proportion Var 0.15 0.12 0.09
Cumulative Var 0.15 0.27 0.37

Test of the hypothesis that 3 factors are sufficient.


The chi square statistic is 87.88 on 63 degrees of freedom.
The p-value is 0.0209
fourfactor <- factanal(soupdata, factors = 4, fm = "minres")
> print(fourfactor, digits = 2, cutoff = 0.4)

Call:
factanal(x = soupdata, factors = 4, fm = "minres")

Uniquenesses:
V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13
V14 V15
0.69 0.55 0.48 0.52 0.65 0.45 0.55 0.74 0.74 0.12 0.87 0.60 0.57
0.65 0.78

Loadings:
Factor1 Factor2 Factor3 Factor4
V1 0.49
V2 0.66
V3 0.64
V4 0.58
V5 0.53
V6 0.65
V7 0.54
V8 0.49
V9
V10 0.92
V11
V12 0.60
V13 0.60
V14 0.51
V15

Factor1 Factor2 Factor3 Factor4


SS loadings 2.20 1.80 1.37 0.64
Proportion Var 0.15 0.12 0.09 0.04
Cumulative Var 0.15 0.27 0.36 0.40

Test of the hypothesis that 4 factors are sufficient.


The chi square statistic is 64.63 on 51 degrees of freedom.
The p-value is 0.0951
fivefactor <- factanal(soupdata, factors = 5, fm = "minres")
> print(fivefactor, digit= 2, cutoff = 0.4)

Call:
factanal(x = soupdata, factors = 5, fm = "minres")

Uniquenesses:
V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13
V14 V15
0.73 0.61 0.00 0.70 0.52 0.00 0.66 0.76 0.71 0.24 0.81 0.62 0.50
0.62 0.72

Loadings:
Factor1 Factor2 Factor3 Factor4 Factor5
V1 0.41
V2 0.58
V3 0.45 0.88
V4 0.42
V5 0.66
V6 0.90
V7
V8 0.44
V9
V10 0.85
V11 0.40
V12 0.52
V13 0.69
V14 0.56
V15

Factor1 Factor2 Factor3 Factor4 Factor5


SS loadings 1.74 1.51 1.34 1.24 0.98
Proportion Var 0.12 0.10 0.09 0.08 0.07
Cumulative Var 0.12 0.22 0.31 0.39 0.45

Test of the hypothesis that 5 factors are sufficient.


The chi square statistic is 42.95 on 40 degrees of freedom.
The p-value is 0.346
Comparison of using ‘fa’ and ‘factanal’:

In factanal we can get extra information

1) Uniqueness
2) chi square statistic
3) Degree of Freedom
4) P value

Also, there is slightly different result we get while using two different methods:

While using ‘factanal’ total variance for five factor model is 0.45, which is same as ‘fa’ method
but for four factoral model while using ‘factanal’ total variance is 0.40 but while using ‘fa’ method total
variance is 0.388.

Reliability:

Reliability refers to whether or not we get the same answer by using an instrument to measure
something more than once. In simple terms, research reliability is the degree to which research method
produces stable and consistent results.

 The term reliability in research refers to the consistency of a research study or measuring test.
 There are two types of reliability – internal and external reliability.
o Internal reliability assesses the consistency of results across items within a test.
o External reliability refers to the extent to which a measure varies from one use to
another.

Reason for reliability to ensure in research instruments:

Assessing Reliability

Internal

 Split-half method
The split-half method assesses the internal consistency of a test, such as psychometric tests and
questionnaires. There, it measures the extent to which all parts of the test contribute equally to
what is being measured.
External

 Test-retest
The test-retest method assesses the external consistency of a test. Examples of appropriate
tests include questionnaires and psychometric tests. It measures the stability of a test over time.
 Inter-rater reliability
The test-retest method assesses the external consistency of a test. This refers to the degree to
which different raters give consistent estimates of the same behavior. Inter-rater reliability can
be used for interviews.

Validity:
Validity tells you us accurately a method measure something. If a method measures what it claims to
measure, and the results closely correspond to real-world values, then it can be considered valid. There
are four main types of validity:

 Construct validity: Does the test measure the concept that it’s intended to measure?
 Content validity: Is the test fully representative of what it aims to measure?
 Face validity: Does the content of the test appear to be suitable to its aims?
 Criterion validity: Do the results correspond to a different test of the same thing?

Reliability vs Validity

Reliability Validity

What does it tell us? The extent to which the results The extent to which the results
can be reproduced when the really measure what they are
research is repeated under the supposed to measure.
same conditions.

How is it assessed? By checking the consistency of By checking how well the results
results across time, across correspond to established
different observers, and across theories and other measures of
parts of the test itself. the same concept.

How do they relate? A reliable measurement is not A valid measurement is


always valid: the results might generally reliable: if a test
be reproducible, but they’re not produces accurate results, they
necessarily correct. should be reproducible.

You might also like