Вы находитесь на странице: 1из 123

RESEARCH METHODOLOGY LAB

(Using MS Excel and R Studio)


PRACTICAL FILE

Submitted for partial fulfillment for the award of the Degree of

BACHELOR OF BUSINESS ADMINISTRATION


{BBA (G) 2018 – 2021}

Under the supervision of

Dr. AANCHAL AGGARWAL

Submitted by

NAME OF THE STUDENT: ANURAG MISHRA

ENROLLMENT NO.: 01817701718

VIVEKANANDA SCHOOL OF BUSINESS STUDIES


VIVEKANANDA INSTITUTE OF PROFESSIONAL STUDIES
(Affiliated to Guru Gobind Singh Indraprastha University)

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


INDEX
TOPIC PAGE NO.
FUNCTIONS
 Count
 Count A
 Count Blank
 Sum
 Max
 Min
 Average
 Count If
 Sum IF
 Average If
 Concatenate
 VLOOKUP
 VLOOKUP+ Dropdown
 HLOOKUP
 OTHER TOOLS
 Transpose table
 Text to Column
 Conditional Formatting- Highlight Cell rules (greater than, less than,
 between, equal to, text that contains)
 Conditional Formatting - Duplicate values
 Conditional Formatting - Top/ Bottom rules
 Conditional Formatting - Data Bars
 Conditional Formatting - Color Scales
 Format as Tables
 Format Cells – Number, Alignment, Font, Border, Fill
 Cell Styles
 Data validation – settings (Any value, number, custom)
 Data validation – Input message
 Data validation – Error alert
 Customization – Ribbon
 Customization- Quick access toolbar
 Backstage view
 Save as adobe pdf
 DATA VISUALIZATION AND ANALYSIS
 Frequency
 Relative frequency
 Percentage frequency
 Bar Graph
 Histogram using Graph tab
 Pivot Table and its tools
 Pivot Chart and its tools

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


 Histogram frequency distribution
 Histogram – Chart output
 Histogram – Pareto (sorted diagram)
 Histogram – Cumulative percentage
 Descriptive statistics
 Descriptive statistics for various scales
 Correlation
 HYPOTHESIS TESTING
 One sample t test using dummy (one-tailed)
 One sample t test using dummy (two-tailed)
 One sample t test using test average (one- tailed)
 One sample t test using test average (two- tailed)
 t test using function (all combinations)
 Two sample - Independent sample t test
 Two sample - Paired Sample t test
 Two sample z test
 ANOVA – Single Factor
 ANOVA – Two Factor without replication
 ANOVA – Two Factor with replication
 F test
 Chi square test

 INTRODUCTION TO R
 How to install R Studio
 Four Panes in R
 Import of Data Sheet in Excel
 Descriptive statistics
 Correlation
 Hypothesis Testing: Two sample - Independent sample t test
 Hypothesis Testing: Two sample - Paired Sample t test
 Hypothesis Testing: One-way ANOVA
 Hypothesis Testing: F test
 Hypothesis Testing: Chi square test

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


FUNCTIONS
1. COUNT FUNCTION IN EXCEL
STEPS:

1) Select the data range

2) Apply the formula: “=COUNT(B1:B9)”

3) Press enter

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


2. COUNT A FUNCTION IN EXCEL
SYNTAX : =COUNTA(value1, value2,....)

STEPS :

1) Select the range of data

2) Apply the formula : “=COUNTA(B1:B9)”

3) Press ENTER

3. COUNT BLANK FUNCTION IN EXCEL


SYNTAX : COUNTBLANK(value1, value2,...)

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


STEPS :

1) Select the data of marks in subject 2.

2) Apply the formula: “=COUNTBLANK(B1:B9)”

3) Press ENTER.

4. SUM FUNCTION IN EXCEL


SYNTAX : =SUM(value1, value2,...)

STEPS :

1) Type the formula, ie,“ =SUM(D2:H2)” in the cell “K1”.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


2) Press ENTER, to get the sum.

3) Click the corner of the K1 cell with the sum and drag till K9 to get the corresponding
values of the sum in both the subjects for all the students.

5. MAXIMIZATON FUNCTION IN EXCEL


SYNTAX : =MAX(value1, value2,...)

STEPS :

1) Type the formula, ie,“ =MAX(D2:D9)” in the cell “D20”.

2) Press ENTER, to get the maximum marks in subjects.

It gives the maximum marks ,ie, 89,96,86,87,87

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


6. MINIMIZATION FUNCTION IN EXCEL
SYNTAX : =MIN(value1, value2,...)

STEPS :

1) Type the formula, ie=MIN(D2:D9)” in the cell “D21”.

2) Press ENTER, to get the minimum marks in subjects.

It gives the minimum marks ,ie, 45,45,47,57,48

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


7. AVERAGE FUNCTION IN EXCEL
SYNTAX: =AVERAGE(value1, value2,...)

STEPS :

1) Type the formula “=AVERAGE(D2:D9)” in the cell “D22”.

2) Press ENTER.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


8. COUNT IF FUNCTION IN EXCEL
SYNTAX: =COUNTIF (range, criteria)

STEPS TO COUNT THE NUMBER OF STUDENTS FROM “SUBJECTS” :

1. Select the cell where you want to apply the countif function.

2. Type =COUNTIF(D2:D9,">75").
3. Press ENTER.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


9. SUM IF FUNCTION IN EXCEL
SYNTAX: =SUMIF(range,criteria,sum_range)

TO CALCULATE SUM OF “MARKS” OF STUDENTS FROM “STUDENTS”

STEPS:

1. Select the cell where you want to apply the sumif function.

2. Type =SUMIF(C2:C9,B17,K2:K9)
3. Press ENTER.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


10.AVERAGE IF FUNCTION IN EXCEL
SYNTAX :

SYNTAX: =AVERAGEIF(range,criteria,average_range)

TO CALCULATE AVERAGE OF “MARKS” OF STUDENTS FROM “SUBJECTS”

STEPS:

1. Select the cell where you want to apply the averageif function.

2. Type =AVERAGEIF(C2:C9,C2,D2:H9)

3. Press ENTER.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


11.CONCATENATE IF FUNCTION IN EXCEL
SYNTAX :

SYNTAX : =CONCATENATE(value1, value2,...)

STEPS :

1) Select the cell where you want to enter the formula and get the result.

2) Type =CONCATENATE(C2,", ",A2)

3) Press ENTER.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


12.VLOOKUP IF FUNCTION IN EXCEL
SYNTAX : =VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])

STEPS : 1) Click the cell where the VLOOKUP is to be calculated, ie, “ B29” and type the formula
for VLOOKUP.

2) Specify the cell in which you will enter the value whose data you’re looking for, “A29”.

3) Specify the data which you want VLOOKUP to use for its search in the table_array box, ie,
“A2:H9”.

4) Specify the column number which VLOOKUP will use to find the relevant data in the
col_index_num box, ie, “2”.

5) Specify FALSE to get exact match.

6) Press ENTER.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


13.VLOOKUP + DROPDOWN IF FUNCTION IN EXCEL
STEPS:
1) Select the Cell with the lookup value, ie, “A29”.
2) Data < Data Validation.
Following dialogue box will open.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


14.HLOOKUP IF FUNCTION IN EXCEL
SYNTAX : =HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup])
STEPS :

1) Click the cell where the HLOOKUP is to be calculated, and type the formula for HLOOKUP.

2) Specify the cell in which you will enter the value whose data you’re looking for, “ N12”.

3) Specify the data which you want HLOOKUP to use for its search in the table_array box, ie,
“B12:I14”.

4) Specify the row number which HLOOKUP will use to find the relevant data in the
row_index_num box, ie, “2”.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


5) Specify FALSE to get exact match.

6) Press ENTER.

OTHER TOOLS
1. TRANSPOSE TABLE IN EXCEL
STEPS :
1) Select the given data, ie, A1:H9 and copy it.
2) Select the area where the transpose is to be pasted, ie, A12:I19
3) In the “Home” ribbon, go to Paste > Transpose.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


2. TEXT TO COLUMN IN EXCEL
STEPS :
1) Select the data.
2) Data < Data Columns <Text to Columns. Following dialogue box will open.
3)Choose deliminited. Click NEXT. Choose COMMA and SPACE. Click FINISH.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


3. Conditional Formatting – Highlight Cell rules (greater than)
STEPS : HIGHLIGHT CELL RULES –
1) Select the data , ie, marks of the students to highlight the marks of students above 90.
2) Home < Conditional Formatting < Highlight cells rules < Greater than.
3) Enter 90 in the box and select Green fill with dark green text.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


4. Conditional Formatting – Highlight Cell rules (less than)
STEPS : HIGHLIGHT CELL RULES –
1) Select the data , ie, marks of the students to highlight the marks of students less than 40
2) Home < Conditional Formatting < Highlight cells rules < Less than.
3) Enter 40 in the box and select Light red fill with dark red text.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


5. Conditional Formatting – Highlight Cell rules (between)
STEPS : HIGHLIGHT CELL RULES –
1) Select the data , ie, marks of the students to highlight the marks of students Between 68 to 75
2) Home < Conditional Formatting < Highlight cells rules < between.
3) Enter 68 and 75 in the box and select Yelow fill with dark yellow text.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


6. Conditional Formatting – Highlight Cell rules (equal to)
STEPS : HIGHLIGHT CELL RULES –
1) Select the data , ie, marks of the students to highlight the marks of students e qual to 88
2) Home < Conditional Formatting < Highlight cells rules < equal to.
3) Enter 88 in the box and select red border.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


7. Conditional Formatting – Highlight Cell rules (text that contains)
STEPS : HIGHLIGHT CELL RULES –
1) Select the data , ie, stream of the students to highlight the stream of students
2) Home < Conditional Formatting < Highlight cells rules < text that contains
3) Enter 68 and 75 in the box and select “custom format”.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


8. Conditional Formatting – TOP RULES

STEPS:

1) Select the data, i.e. marks of the students to highlight the marks of students.

2)Home < Conditional Formatting < Top Rules < Top 10 items.

3) Enter 10 to highlight top 10 and select Yellow fill with dark yellow text.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


9. Conditional Formatting – BOTTOM RULES
STEPS:
1) Select the data, i.e. marks of the students to highlight the marks of students.
2)Home < Conditional Formatting < Bottom Rules < Top 10 items.
3) Enter 10 to highlight top 10 and select light red fill with dark red text.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


10. Conditional Formatting – DATA BARS

STEPS:

1. Select the data, i.e. marks of the students.


2. Go to Home > Conditional formatting > Data Bars.
3. Select any among the options.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


11. Conditional Formatting – COLOUR SCALES

STEPS:

1. Select the data, i.e. marks of the students.


2. Go to Home > Conditional formatting > Color scales.
3. Select any among the options.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


12. FORMAT AS TABLE IN EXCEL
STEPS:
1) Home < Format as table
2) Dialogue box will appear. Enter the source of data which is to be formatted in tabular form.
3) Click OK.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


13. Format Cells – NUMBER, ALIGNMENT, FONT, BORDOR, FILL

STEPS:

1) Select the cell that you wish to format.

2) Home < Format < Format Cells.

3) A dialogue box will appear with several tabs.

4) In the number tab, select TEXT. In alignment, select BOTTOM. In font select CAMBRIA,
ITALICS and SINGLE UNDERLINE. Then select a border and a colorfill.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


5) Click OK.

NUMBER ALIGNMENT

FONT

BORDOR

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


FILL

14. CELL STYLES IN EXCEL


STEPS:
1) Select the cell that you wish to format.
2) Home < Format < Cell Styles
3) Select Style

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


15. Data Validation – Setting(NUMBER)

STEPS :

1. Select the marks of students.


2. Data < Data Validation.
3. Dialogue box will open. In the settings tab, in the allow box, select “whole number”.
4. Enter the maximum value as “100” and minimum value as “0”.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


5. Click OK.

16. Data Validation – INPUT MESSAGE


STEPS:
1)Select the marks of students.
2)Data < Data Validation.
3)Dialogue box will open. Go to Input message tab.
4)Enter the title as marks.
5)Enter the input message as “PLEASE ENTER WHOLE NUMBER ONLY”
6)Click OK.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


17. Data Validation – ERROR ALERT

NOTE : If any other value is entered, Excel shows an Error message, ie, “The value you entered is
not valid.”

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


18. CUSTOMIZATION – QUICK ACCESS TOOLBAR

STEPS:

1. Click on “Office” button.


2. Go to Excel options.
3. Click on ‘Customize’.
4. Following dialogue box will open :

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


5.

Now click the items you wish to add to the quick access toolbar, by selecting them and then
clicking “add”.
6. Click OK.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


19. BACKSTAGES VIEW IN EXCEL

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


DATA VISUALIZATION AND ANALYSIS
1. Frequency
STEPS:
1. Create classes for the data and generate “Bin” which is the lower limit of each class.
2. Go to Data > Data analysis > Histogram.
3. Select the Marks as input range.
4. Select the bin column as bin range.
5. Enter output range.
6. Click OK.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


2. Relative Frequency

FORMULA: Individual Frequency/Total Frequencies

STEPS: Apply the formula of relative frequency, ie, H13/H20, and so on for all the frequencies.

3. Percentage Frequency

FORMULA: Individual Frequency/Total Frequencies*100

STEPS: Apply the formula of relative frequency, ie, H13/H20*100, and so on for all the frequencies.

4. Bar Graph

STEPS:

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


1. Select the data, ie, Frequencies and the class intervals.
2. Insert > Bar > Select the bar graph.

5. Pivot Table and its tools


STEPS:
1) Select the data.
2) In the ribbon, go to: Insert > Pivot Table Button. The following dialogue box will open :

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


3) Select a Table or range and then select the table consisting data of sales value.

4) Choose PivotTable report to be placed on the existing worksheet and enter the location for the
same.

5) Click OK.

6) Tick all the fields to add them to the report. Drag the “Sales value” Label field into values,
“Product” into Column labels, “Company” and “Salesperson” into Row column.

6. Pivot Chart and its tools


STEPS:
1) Select the data.
2) In the ribbon, go to: Insert > Pivot Table Chart Button.
3) Enter the input range as the table.
4) Choose Pivot Chart to be placed on the existing worksheet and enter the location for the same.
5) Click OK.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


7. Histogram frequency distribution

STEPS:

1. Data > Data Analysis > Histogram.


2. Select the input range, ie, Marks
3. Select the bin range.
4. Tick on the “chart output” option.
5. Click OK.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


8. HISTOGRAM – Pareto & Cumulative Percentage
STEPS:
1. Data > Data analysis > Histogram
2. Select the Marks as input range.
3. Select the bin range.
4. Tick Pareto chart, cumulative percentage and chart output.
5. Click OK.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


9. DESCRIPTIVE STATISTICS:

STEPS :

1. Since descriptive statistics tool require numeric data, we will convert the non numeric data,
into numeric data by generating the codes given in the table below.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


Gender code
Male 1
Female 0
Education Code
Graduate 1
Post Graduate 2
Post Graduate and Professional Degree 3
Doctorate 4
2. Using these codes and using “IF” function, determine codes for all observations for gender as
well as education.
3. Go to Data > Data analysis > Descriptive Statistics. Click OK.
4. In the input range select the work experience, work code & education code column.
5. Tick on grouped by “columns”.
6. Select the output range.
7. Click OK.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


10. Correlation
SYNTAX : CORREL(range1, range2)
STEPS : 1) Type the formula of correlation in the cell.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


2) Select range1, and range2.

3) Press ENTER.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


HYPOTHESIS TESTING
T-Test

A. One sample t test using dummy (one tailed)

Problem

To determine that a population mean of age is greater than 40 and α=0.05

Age Dummy
42 0
76 0
56  
67  
65  
65  
89  
76  
45  
45  
65  
78  
55  
52  
 
53
44  
65  
76  
89  
44  
54  
45  
56  
56  
56  
76  

Hypothesis Testing :-
H0: µ<=40

H1: µ=40

t-Test: Two-Sample Assuming Equal

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


Variances

  Age
Mean 61.15384615
Variance 195.7353846
Observations 26
Pooled Variance 188.2071006
Hypothesized Mean Difference 40
df 26
t Stat 2.101328716
P(T<=t) one-tail 0.022727409
t Critical one-tail 1.70561792
P(T<=t) two-tail 0.045454818
t Critical two-tail 2.055529439

Decision Rule:

If T stats is > t-critical, reject null hypothesis

If P(T) is < than α, reject null hypothesis

Inference:

Since T-stats (2.10) is greater than t-Critical (1.70), therefore reject


null hypothesis

Since p(0.02) is less than α(0.05), therefore reject null hypothesis

Conclusion:

Mean age of population is greater than 40 and α is equal to 0.05

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB
ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB
Two Sample t-Test

Research Problem

That there is a significant difference between marks scored by class group


A and B in mathematics and α = 0.05

Hypothesis

Group A Group B
76 95
87 97
98 87
45 89
66 87
78 45
76 76
88 56
78 76
87 87
54 45
65 76
75 45
89 88
65 76
78 66
54 78
87 56
45 77

Hypothesis Testing :-

H0: µA ≠µB
H1: µA = µB

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


t-Test: Two-Sample Assuming Equal
Variances

  Group A Group B
Mean 73.21052632 73.78947368
Variance 236.5087719 287.3976608
Observations 19 19
Pooled Variance 261.9532164
Hypothesized Mean Difference 0
df 36
t Stat -0.110252646
P(T<=t) one-tail 0.456410681
t Critical one-tail 1.688297714
P(T<=t) two-tail 0.912821361
t Critical two-tail 2.028094001  

Decision Rule:

If T stats is > t-critical, reject null hypothesis

If P(T) is < than α, reject null hypothesis

Inference:

Since T-stats (-0.110) is less than t-Critical (2.028), therefore accept


null hypothesis

Since p(0.91) is greater than α(0.05), therefore accept null hypothesis

Conclusion:

There is no significant difference between the marks of group A and group B


in Mathematic at α=0.05

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB
ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB
T – Test

Research problem
Two type of drugs were used on 5 and 7 patients for reducing their weight, drug A
was imported and drug B was indigenous, the decrease in the weight after using
drugs for 6 months was as follows:

Drug A Drug B
10 8
12 9
13 12
11 14
14 15
  10
  9

Is there a significant difference in the efficiency of 2 drugs assuming equal


variances at α = 0.05

Hypothesis

H0 = No significant difference

H1 = Significant difference

µA = efficiency of drug A

µB = efficiency of drug B

H0 = µA - µB = 0

H1 = µA - µB ≠ 0

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


t-Test: Two-Sample Assuming Equal
Variances

  Drug A Drug B
Mean 12 11
Variance 2.5 7.333333333
Observations 5 7
Pooled Variance 5.4
Hypothesized Mean Difference 0
df 10
t Stat 0.73493092
P(T<=t) one-tail 0.239630988
t Critical one-tail 1.812461123
P(T<=t) two-tail 0.479261977
t Critical two-tail 2.228138852  

Decision rule

If T stat is greater than T critical reject null hypothesis.

If P (t) value is less than α, reject null.

Inference

Here t stat (0.73) is less than t critical (2.22), therefore accept null
hypothesis.

Here P (0.4) is greater than α (0.05), therefore accept null hypothesis

Conclusion

There is no significant difference between Drug A and Drug B at α = 0.05.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB
ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB
T-Test

Research Problem
Is there sufficent evidence to suggest that the mean time to exhaustion is
greater after chocolate milk than after carbohydrate replacement drink? Use
a significant level of 0.05.

Chocolate Carbohydrate Replacement


Cyclist Milk Drink
1 50.46 42.9

2 47.08 50.1
3 57.51 41.67
4 46.9 32.69
5 29.1 46.33
6 57.5 31.63
7 23.87 20.61
8 28.65 14.99
9 35.37 20.11

Hypothesis Testing -

H0 :-There issufficent evidence to suggest that the mean time to exhaustion


is not greater after chocolate milk than after carbohydrate replacement
drink.

:- µCM ≤ µCD
H1:- :- There issufficent evidence to suggest that the mean time to exhaustion
isgreater after chocolate milk than after carbohydrate replacement drink.

:- µCM >µCD

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


t-Test: Paired Two Sample for
Means

Chocolate Carbohydrate Replacement


  Milk Drink
Mean 41.82666667 33.44777778
Variance 164.90175 160.9338194
Observations 9 9
Pearson Correlation 0.507660349
Hypothesized Mean Difference 0
df 8
t Stat 1.984538056
P(T<=t) one-tail 0.041233711
t Critical one-tail 1.859548038
P(T<=t) two-tail 0.082467422
t Critical two-tail 2.306004135  

Decision Rule:

If T stats is > t-critical, reject null hypothesis

If P(T) is < than α, reject null hypothesis

Inference:

Since T-stats 1.98) is more than t-Critical (1.85), therefore reject null
hypothesis

Since p(0.04) is greater than α(0.05), therefore accept null hypothesis

Conclusion:

There issufficent evidence to suggest that the mean time to exhaustion is


greater after chocolate milk than after carbohydrate replacement drink
α=0.05.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB
ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB
T-test

Research problem
Coaching was given to student for stastistical software after their result
was evaluated in january in order to improve their performance in april
exams. Determine if the coaching was successful.

Jan May

45 56
54 57
44 45
56 67
34 44
45 34
34 34
67 76
45 56
54 45
67 76
56 87
56 66
56 65
76 45

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


76 76

Hypothesis Testing: -

H0 :-µmay ≤µjan

H1 :-µmay >µjan

t-Test: Paired Two Sample


for Means

  Jan May
Mean 54.0625 58.0625
Variance 164.3291667 258.0625
Observations 16 16
Pearson Correlation 0.591118937
Hypothesized Mean Difference 0
df 15
t Stat -1.19611891
P(T<=t) one-tail 0.125107938
t Critical one-tail 1.753050356
P(T<=t) two-tail 0.250215876
t Critical two-tail 2.131449546  

Decision rule

If T stat is greater than T critical reject null hypothesis.

If P (t) value is less than α, reject null.

Inference

Here t stat (-1.19) is less than t critical (1.75), therefore accept null
hypothesis.

Here P (0.12) is greater than α (0.05), therefore accept null hypothesis

Conclusion

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


Therefore, the coaching was not successful at α = 0.05.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB
ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB
T-test

Research problem
Diet was given to 8 patients for weight loss. The weight (in llb) are as follows.
Determine whether the diet was effective?

Before After
162 168
170 136
184 147
164 159
172 143
176 161
159 143
170 145

Hypothesis Testing: -

H0 :-Diet given to 8 paitents for weight loss was not effective. Patient
didn’t loose there weight.

:- µB≤µA
H1:- :- Diet given to 8 paitents for weight loss was effective. Patient loose
there weight.

:- µB>µA

t-Test: Paired Two Sample for Means

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


  Before After
Mean 169.625 150.25
Variance 65.125 121.9285714
Observations 8 8
Pearson Correlation -0.176747772
Hypothesized Mean Difference 0
df 7
t Stat 3.706873373
P(T<=t) one-tail 0.003792994
t Critical one-tail 1.894578605
P(T<=t) two-tail 0.007585988
t Critical two-tail 2.364624252  

Decision rule

If T stat is greater than T-critical reject null hypothesis.

If P (t) value is less than α, reject null.

Inference

Here t stat (3.70) is more than t critical (1.89), therefore reject null
hypothesis.

Here P (0.003) is smaller than α (0.05), therefore reject null hypothesis

Conclusion

Therefore, Diet given to 8 paitents for weight loss was effective. Patient
loose there weight
α = 0.05.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB
ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB
F-test

Research problem
Determine whether or not there is a significance difference between
variances of two sets.

Group 1 Group 2
150 125
175 165
160 130
130 155
160 170
145 150

Hypothesis Testing: -

H0 :- There is no significance difference between variances of two sets.

:- µ1≠µ2
H1:- :- There is significance difference between variances of two sets.

:- µ1=µ2

F-Test Two-Sample for


Variances

  Group 1 Group 2
Mean 153.3333333 149.1666667
Variance 236.6666667 334.1666667
Observations 6 6
df 5 5
F 0.708229426
P(F<=f) one-tail 0.357123518
F Critical one-tail 0.1980069  

Here group 1 variance is less than group 2 variance, so will swap the
values.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


Swapped Variance Table
F-Test Two-Sample for Variances
(Swapped)

  Group 2 Group 1
Mean 149.1666667 153.3333333
Variance 334.1666667 236.6666667
Observations 6 6
df 5 5
F 1.411971831
P(F<=f) one-tail 0.357123518
F Critical one-tail 5.050329058  

Decision rule

If F is greater than F-critical reject null hypothesis.

If P(F<=f) value is less than α, reject null.

Inference

Here F(1.411) is less than F critical (5.050), therefore accept null hypothesis.

Here P(F<=f) (0.357) is greater than α (0.05), therefore accept null hypothesis

Conclusion

There is no significance difference between variances of two sets α = 0.05.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB
ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB
{Swapped Value of F-test}

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


F-test

Research problem
Determine whether or not there is a significant difference between variance
of mathematics score of two class groups.

Class
1 Class2
65 76
76 54
65 57
76 65
56 76
45 66

Hypothesis Testing: -

H0: - There is no significant difference between variance of


mathematics score of two class groups.

: - µ1≠µ2
H1: -There is a significant difference between variance of
mathematics score of two class groups.

: - µ1=µ2

F-Test Two-Sample for


Variances

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


  Class 1 Class2
Mean 63.83333 65.66667
Variance 142.9667 85.06667
Observations 6 6
df 5 5
F 1.680643
P(F<=f) one-tail 0.291354
F Critical one-tail 5.050329  

Decision rule

If F is greater than F-critical reject null hypothesis.

If P(F<=f) value is less than α, reject null.

Inference

Here F (1.68) is less than F critical (5.05), therefore accept null hypothesis.

Here P(F<=f) (0.29) is greater than α (0.05), therefore accept null hypothesis.

Conclusion

There is no significance difference between variances of two sets α = 0.05.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB
ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB
Z-test

Research problem
The net annual returns (the returns on investment after deducting all relevant
fees) in percentage are given. Can investors do better by buying mutual funds
directly from banks or other financial institutions than by purchasing mutual
funds through brokers. Can we conclude at the 5% significance level that directly-
purchased mutual funds outperform mutual funds bought through brokers?

Direct Broker 2.69 -0.85


9.33 3.24 18.45 -0.28
6.94 -6.76 4.23 16.4
16.17 12.8 10.28 6.39
16.97 11.1 7.1 -1.9
5.94 2.73 -3.09 9.49
12.61 -0.13 5.6 6.7
3.33 18.22 5.27 0.19
16.13 -0.8 8.09 12.39
11.2 -5.75 15.05 6.54
1.14 2.59 13.21 10.92
4.68 3.71 1.72 -2.15
3.09 13.15 14.69 4.36
7.26 11.05 -2.97 -11.07
2.05 -3.12 10.37 9.24
13.07 8.94 -0.63 -2.67
0.59 2.74 -0.15 8.97
13.57 4.07 0.27 1.87
0.35 5.6 4.59 -1.53

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


6.38 5.23
-0.24 6.87
10.32 -1.69
10.29 9.43
4.39 8.31
-2.06 -3.99
7.66 -4.44
10.83 8.63
14.48 7.06
4.8 1.57
13.12 -8.44
-6.54 -5.72
-1.06 6.95

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


Hypothesis Testing: -

H0: - µd ≤µb

H1: - µd>µb

z-Test: Two Sample for


Means

  Direct Broker
Mean 6.6312 3.7232
Known Variance 37.48818 43.33928
Observations 50 50
Hypothesized Mean
Difference 0
z 2.287177862
P(Z<=z) one-tail 0.011092722
z Critical one-tail 1.644853627
P(Z<=z) two-tail 0.022185444
z Critical two-tail 1.959963985  

Decision rule

If z is greater than z-critical reject null hypothesis.

If P(Z<=z)value is less than α, reject null.

Inference

Here z (2.28) is more than z critical (1.64), therefore reject null hypothesis.

Here P(Z<=z) (0.01) is smaller than α (0.05), therefore reject null hypothesis.

Conclusion

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


The 5% significance level that directly-purchased mutual funds outperform
mutual funds bought through brokersα = 0.05.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB
Anova – Single factor

Research problem
The Marks for three different groups in economics, science, history are given below.
Determine whether there is a significant difference between the mean of population.

Economics Science History


42 69 35
53 54 40
49 58 53
53 64 42
43 64 50
44 55 39
45 56 55
52   39
54   40

Hypothesis Testing: -

H0: -µ1 =µ2 =µ3

H1: - At least one of the means is different


Anova: Single
Factor

SUMMARY
Groups Count Sum Average Variance
Economics 9 435 48.33333 23.5
Science 7 420 60 32.33333
History 9 393 43.66667 50.5

ANOVA
Source of SS df MS F P-value F crit

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


Variation
7.16E-
Between Groups 1085.84 2 542.92 15.19623 05 3.443357
Within Groups 786 22 35.72727

Total 1871.84 24        

Decision rule

If F is greater than F-critical reject null hypothesis.

If Pvalue is less than α, reject null.

Inference

Here F(15.19) is more than F-critical (3.44), therefore reject null hypothesis.

Here Pvalue (7.16) is smaller than α (0.05), therefore reject null hypothesis.

Conclusion

Therefore we will reject Null Hypothesis, andat least one of the means is different.

t-Test: Two-Sample Assuming Equal


Variances

  Economics Science
Mean 48.33333 60
Variance 23.5 32.33333
Observations 9 7

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


Pooled Variance 27.28571
Hypothesized Mean Difference 0
df 14
t Stat -4.43189
P(T<=t) one-tail 0.000284
t Critical one-tail 1.76131
P(T<=t) two-tail 0.000569
t Critical two-tail 2.144787  
t-Test: Two-Sample Assuming Equal
Variances

  Science History
Mean 60 43.66667
Variance 32.33333 50.5
Observations 7 9
Pooled Variance 42.71429
Hypothesized Mean Difference 0
df 14
t Stat 4.959051
P(T<=t) one-tail 0.000105
t Critical one-tail 1.76131
P(T<=t) two-tail 0.00021
t Critical two-tail 2.144787  
t-Test: Two-Sample Assuming Equal
Variances

  History Economics
Mean 43.66667 48.33333
Variance 50.5 23.5
Observations 9 9
Pooled Variance 37
Hypothesized Mean Difference 0
df 16
t Stat -1.62747
P(T<=t) one-tail 0.061584
t Critical one-tail 1.745884
P(T<=t) two-tail 0.123167
t Critical two-tail 2.119905  

Decision rule
- If T stat is greater than T

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


critical reject null
hypothesis.
- If P (t) value is less
than α, reject null.

Economics Science

H0 :- µe = µs
H1 :- µe ≠ µs

Accept Null

  Economics Science

H0 :- µs = µh
H1 :- µs ≠ µh

Reject Null

History Economics

H0:- µh= µe
H1:- µh ≠ µe

Accept Null

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB
ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB
Anova – Two factor without implications.

Research problem
Determine whether there is a significant different between marks of student,
Subject-vise or student-wise.

Economics Science History

Student a 42 69 35

b 53 54 40

c 49 58 53

d 53 64 42

e 43 64 50

Hypothesis Testing: -

H1: - there is a significant different between marks of student


Student-wise(Row)

H0: - No there is a significant different between marks of student


Subject-wise (Column)

Anova: Two-Factor Without


Replication

SUMMARY Count Sum Average Variance


Student a 3 146 48.66667 322.3333

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


b 3 147 49 61
c 3 160 53.33333 20.33333
d 3 159 53 121
e 3 157 52.33333 114.3333

Economics 5 240 48 28
Science 5 309 61.8 34.2
History 5 220 44 54.5

ANOVA
Source of Variation SS df MS F P-value F crit
Rows 60.93333 4 15.23333 0.300263 0.869889 3.837853
Columns 872.1333 2 436.0667 8.595269 0.010172 4.45897
Error 405.8667 8 50.73333

Total 1338.933 14        

Decision rule

If F is greater than F-critical reject null hypothesis.

If Pvalue is less than α, reject null.

Inference (Row)

Here F (0.30) is less than F-critical (3.83), therefore accept null hypothesis.

Here Pvalue (0.86) is more than α (0.05), therefore accept null hypothesis.

Inference (Column)

Here F (8.59) is more than F-critical (4.45), therefore reject null hypothesis.

Here Pvalue (0.01) is smaller than α (0.05), therefore reject null hypothesis.

Conclusion

Therefore there is no significant difference between marks of student, Student-wise,

and there is a significant difference between marks of student, subject-wise.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB
ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB
Z-test

Research problem

To test whether or not population age differ significantly from 20


years, α=0.05
Age Dummy
25 0
21  
21  
20  

30  
22  
20  
20  
23  
18  
21  
23  
21  
20  
21  
22  
24  
24  
19  
23  
22  
24  

Hypothesis Testing: -
H0: - µ=20

H1: - µ≠20

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


z-Test: One Sample for
Means

  Age Dummy
Mean 22 0
Known Variance 25 0.0001
Observations 22 1
Hypothesized Mean
Difference 20
z 1.876083758
P(Z<=z) one-tail 0.03032189
z Critical one-tail 1.644853627
P(Z<=z) two-tail 0.06064378
z Critical two-tail 1.959963985  

Decision rule

If z is greater than z-critical reject null hypothesis.

If P(Z<=z)value is less than α, reject null.

Inference

Here z (1.87) is more than z critical (1.64), therefore reject null hypothesis.

Here P(Z<=z) (0.03) is smaller than α (0.05), therefore reject null hypothesis.

Conclusion

Mean age is not 20 years at α = 0.05.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB
ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB
Z-test
Research problem

The mean annual return from directly purchased mutual funds is larger than the
mean of broker purchased funds.

Direct Broker
9.33 3.24
6.94 -6.76
16.17 12.8
16.97 11.1
5.94 2.73
12.61 -0.13
3.33 18.22
16.13 -0.8
11.2 -5.75
1.14 2.59
4.68 3.71
3.09 13.15
7.26 11.05
2.05 -3.12
13.07 8.94
0.59 2.74
13.57 4.07
0.35 5.6
2.69 -0.85
18.45 -0.28
4.23 16.4
10.26 6.39
7.1 -1.9
-3.09 9.49
5.6 6.7
5.27 0.19
8.09 12.39
15.05 6.54
13.21 10.92
1.72 -2.15
14.69 4.63
-2.97 -11.07
1037 9.24
-0.63 -2.67

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


-0.15 8.97
0.27 1.87
4.59 -1.53
6.38 5.23
-0.24 6.87
10.32 -1.69
10.29 9.43
4.39 8.31
-2.06 -3.99
10.83 8.63
14.48 7.06
4.8 1.57
13.12 -8.44
-6.54 -5.72
-1.06 6.95

Hypothesis Testing: -

H0:- µm - µb ≤ 0
H1:- µm - µb > 0

z-Test: Two Sample

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


for Means

  Direct Broker
Mean 27.56142857 3.895306122
Known Variance 37.488 43.339
Observations 49 49
Hypothesized Mean
Difference 0
z 2.287311718
P(Z<=z) one-tail 0.011088817
z Critical one-tail 1.644853627
P(Z<=z) two-tail 0.022177635
z Critical two-tail 1.959963985  

Decision rule

If z is greater than z-critical reject null hypothesis.

If P(Z<=z)value is less than α, reject null.

Inference

Here z (2.28) is more than z critical (1.64), therefore reject null hypothesis.

Here P(Z<=z) (0.01) is smaller than α (0.05), therefore reject null hypothesis.

Conclusion

It is concluded that mutual fund outperform broker funds.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB
ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB
ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB
ANOVA – Single Factor

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


ANOVA – Two Factor without Replication

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


ANOVA – Two Factor with Replication

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


Chi Square Test

Determine whether brand preference is independent of age group: -

Age/Brand Brand 1 Brand 2 Brand 3 Row Total

15-25 65 76 72 213

26-35 60 40 64 164

36-45 45 52 50 147

46-55 55 65 60 180

Column Total 225 233 246 704

Hypothesis Testing: -

H0:- There is no association between brand preference and age group.


H1:- There is an association between brand preference and age group.

Observed Excepted O-E (O-E)²/E

65 68.0753 -3.0753 0.13893

60 52.4148 7.58523 1.0977

45 46.9815 -1.9815 0.08357

55 57.5284 -2.5284 0.11112

76 70.4957 5.5043 0.42978

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


40 54.2784 -14.278 3.75606

52 48.6519 3.3481 0.23041

65 59.5738 5.4262 0.49424

72 74.4289 -2.4289 0.07926

64 57.3068 6.6932 0.78174

50 51.3665 -1.3665 0.03635

60 62.8977 -2.8977 0.1335

Decision rule:

If Chi square stats are greater than tabulated value, reject null hypothesis.

Inference

If Chi square stats(0.768) are less than tabulated value(12.592), therefore accept
null hypothesis.

Conclusion
There is an association between brand preference and age group.

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB
ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB
INTRODUCTION TO R

How to Install R Studio?

In order to install R Studio,we first need to install R. Following are the steps how
to install R:

1. Go to CRAN, click Download R for Windows, click Base, and download the installer for
the latest R version.
2. Right-click the installer file and select Run as Administrator from the pop-up menu.
3. Select the language to be used during installation.
This doesn’t change the language used by R; all messages and Help files remain in English.
4. Follow the instructions of the installer.
You can safely use the default settings and just keep clicking Next until R starts installing.

After installing the setup of R,we can install the setup of R Studio. Following are
the steps how to install R Studio:

1. Install R. Leave all default settings in the installation options.


2. Open RStudio.
3. Go to the “Packages” tab and click on “InstallPackages”. ...
4. Start typing “Rcmdr” until you see it appear in a list. ...
5. Wait while all the parts of the R Commander package are installed.

Four Panes In R Studio

There are four panes in R Studio also known as windows. These panes are given below:
1.Source

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


2.Console
3.Environment/History
4.Files/Plots/Packages/Help

Source: This is that part of the window where we write our code. Our code will not be evaluated
until we run this code in the console.

Console: This is that part of the pane where our code from the source is evaluated by R. We can
also use the console to perform quick calculations that we don’t need to save.

Environment/History: This is that part of the window where we can see that what objects are in
our working space.

Files/Post/Packages/Help: This is that part of the pane where we can see filedirectories, view
plots,see our packages and access R help.

IMPORTING FILES

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB
Taking assumptions

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


Different types of tests used in R Studio

ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB


ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB
ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB
ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB
ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB
ANURAG MISHRA_01817701718_RESEARCH METHODOLOGY LAB

Вам также может понравиться