0% found this document useful (0 votes)
15 views41 pages

BRM File Final

Uploaded by

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

BRM File Final

Uploaded by

pulkitjain254
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 41

Practical Lab File

On
“BUSINESS RESEARCH METHODOLOGY”

Submitted for the partial fulfillment of the degree of the


“Bachelor of Business Administration”
(2023-2026)

Management Education and Research Institute


Affiliated To Guru Gobind Singh Indraprashta University
Sector 16-C, Dwarka, New Delhi

Supervised By Submitted By
Dr. Simranjeet Kaur Bagga Name- PULKIT JAIN
Assistant Professor Roll No.- 36115101723
DECLARATION
I hereby declare that the following documented practical lab file titled “Business Research
Methodology” submitted by me to Management Education and Research Institute is a bona fide
work undertaken and has not been submitted to any other University or Institution for the award
of any degree diploma/certificate or published any time before.

I hereby certify that all the Endeavour put in the fulfillment of the task are genuine and original
to the best of my knowledge & I have not submitted it earlier elsewhere.

Signature

PULKIT JAIN

BBA, 3rd (semester) - B

Roll no. 36115101723

PAGE \* MERGEFORMAT 2
INTERNAL GUIDE CERTIFICATE
To whomsoever it may concern

This is to certify that the practical lab file work “Business Research Methodology” made by
PULKIT JAIN , BBA, 3rd Semester(B) is an authentic work carried out by her under the
supervision of Internal Guide Dr. Simranjeet Kaur Bagga.

The project report submitted has been found satisfactory for the partial fulfillment of the degree
of Bachelor of Business Administration.

Dr. Simranjeet Kaur Bagga


(Internal Supervisor)

PAGE \* MERGEFORMAT 2
ACKNOWLEDGEMENT
I have been very fortunate to get the opportunity to work on Practical Lab File, “Business
Research Methodology”. I hereby take this opportunity to express my profound gratitude
towards Guru Gobind Singh Indraprashta University for giving me an opportunity to work on a
valuable project.
I would like to extend my deepest regards and gratefulness to Dr. Simranjeet Kaur Bagga
ma’am, my project guide who continuously guided me throughout the course of the project.
Monitoring and constant encouragement throughout the course of this study made the successful
completion of this project possible.

Signature

PULKIT JAIN

BBA, 3rd (semester)- B

Roll no. 36115101723

TABLE OF CONTENTS

PAGE \* MERGEFORMAT 2
S.NO TITLE PAGE NO. SIGNATURE

1 Introduction to R 5-9

2 Write a R program to take input from the user such 10


as name and age and print their value. Also join
name and age and print their values.

3 Write R Program to include all Data Types. 11

4 Write a R program to illustrate the usage of all 12-14


arithmetic, logical and relational operators with two
vectors.
5 Write a R program to find out the descriptive 15-16
statistics value of numeric vector through specified
length of 5.

6 Write a R program to create a matrix of both 17-19


numeric and character to assess and modify.

7 Write a R program to Create a list using Numeric 20-23


and Character vectors in R. Access and modify it
also and merge also.

8 Write a R program to create a data frame, merge 24-25


two data frame also.

9 Write a R program for loop statement such as if, 26-28


else-if, for and while and break statement.

10 Google form and response 29-45

PRACTICAL NO. 1

PAGE \* MERGEFORMAT 2
1.1: INTRODUCTION TO R, THE LANGUAGE

R itself is a language and environment for statistical computing and graphics, which operates as
an integrated suite of software facilities for data manipulation, calculation, and graphical display.
It includes:

● an effective data handling and storage facility,


● a suite of operators for calculations,
● a large, coherent, integrated collection of intermediate tools for data analysis,
● graphical facilities for data analysis and display, either on-screen or on hard-copy, and
● a well-developed, simple and effective programming language

R is a powerful and effective tool for computing, statistics and analysis, and producing data
visualizations. However, many applications exist that can do these or similar things. R has a
number of benefits that make it particularly useful, though.

1.1.1: BENEFITS OF R
First, R is both open source and free. This allows you to take the tool and the skills you’ve
learned with you wherever you go; you are not dependent on your employer to buy or have a
license of a particular software. This is especially relevant as many other software with similar
functionality often cost hundreds, if not thousands, of dollars for a single license.

The open-source nature of R has also resulted in a robust set of users across a wide variety of
disciplines who are constantly updating and revising the language. R therefore has some of the
most up-to-date and innovative functionality and methods available to its users, should they
know where to look.

1.1.2: PACKAGES

PAGE \* MERGEFORMAT 2
Within R, these functions and tools are often implemented as packages. Packages allow
advanced users of R to contribute statistical methods and computing tools to the general users
of R. These packages are reviewed and vetted before being made available for public use; they
are often frequently updated as well. In the first lab, we will install some basic packages that are
frequently used throughout the course.
1.2: R.STUDIO
R Studio is an integrated development environment (IDE) that makes R a bit more user-
friendly. While it is not the only way to use R, it provides a helpful and intuitive interface for
writing and editing code, as well as creating documents and reports. It is not, however, a
requirement for using the R language.
Additionally, it is important to note that R Studio is an entirely separate piece of software - it will
need to be downloaded separately from R.
1.2.1: NAVIGATING RSTUDIO
As you can see, the R Studio interface is primarily composed of 4 quadrants. In the upper-left
corner is the source pane. This is the primarily location where most of your work will take place.
You will write and edit collections of code - or R Scripts - here. When working in the source
pane, your code will not compile until you tell it to run; this allows you the flexibility to work at
your own pace, as well as to save your work.

In the lower left corner is the console, or the command window. The console is the powerhouse
of the software; this is where R actually evaluates code. While you can type code directly into
the console and receive immediate results, it is advisable to stick to the source pane while you
are learning how to use R. Running code in the source pane will automatically produce output in
the console pane.

PAGE \* MERGEFORMAT 2
The upper-right quadrant contains the Environment and History tabs. The Environment tab
displays a list of all the data objects that you have defined in your current R session, as well as
some basic details about the data (such as the number of observations and variables in each). The
History tab contains an archive of all the commands you’ve run in the current session.
Finally, the lower-right quadrant holds a number of helpful navigation tabs. The “Files” tab
displays your hard drive’s own file directory for easy access. The “Plots” tab will show the plots
and visualizations you have created in your current R session. The “Packages” tabs show a list of
all the packages currently installed, as well as an indication of whether or not that are loaded in
the current session. The “Help” tab is, unsurprisingly, the help menu.

Until you are comfortable writing and executing code to analyze data, the RStudio interface can
seem intimidating. Remember - since these are open-source software, there are plenty of
resources online to help as well. A “cheat sheet” for the RStudio IDE can be found here.

1.3: R MARKDOWN

Markdown is a tool for converting plain text into formatted text. R Markdown utilizes the
markdown syntax in order to combine formatted text with code in a single document.

Within RStudio, R Markdown is a specific type of file format for making dynamic documents. It
allows you to simultaneously 1. save and execute code, and 2. produce high quality documents
that include both code and text.

For the purposes of our labs, R Markdown allows us to include code chunks and the text that
helps explain them in an easy-to-read manner. For your own use, R Markdown will allow you to
write documents and reports that include traditional formatted text, as well as the data
visualizations you make in class, and present them both together in a high-quality professional
document.

PAGE \* MERGEFORMAT 2
1.4: FEW COMMANDS

Here are definitions of some commonly used R commands, including ls and ls.str, along with a
few others that are helpful for data manipulation and exploration:

1. ls ()

● Purpose: Lists the objects in the current environment.


● Usage: ls ()
● Example: If you have created variables or functions, running ls() will display their
names.

2. ls.str()

● Purpose: Lists the objects in the current environment along with their structure.
● Usage: ls.str()
● Example: This command provides a brief overview of the objects, showing their type
and structure, which is useful for understanding the data.

3. str()

● Purpose: Displays the structure of an R object.


● Usage: str(object)
● Example: str(my_data) will give you information about the columns in a data frame,
including types and a preview of values.

4. summary()

● Purpose: Provides a summary of the statistical properties of an object.


● Usage: summary(object)
● Example: summary(my_data) gives basic descriptive statistics for each column in a data
frame.

PAGE \* MERGEFORMAT 2
5. length()

● Purpose: Returns the number of elements in an object.


● Usage: length(object)
● Example: length(my_vector) returns the number of elements in my_vector.

6. class()

● Purpose: Returns the class/type of an object.


● Usage: class(object)
● Example: class(my_data) tells you what type of object my_data is (e.g., data frame,
vector).

PAGE \* MERGEFORMAT 2
PRACTICAL NO.2

Write a program to take input from the user such as name and age and print their values.
Also join the name and age and print their values.

#creating name variable

name=PULKIT JAIN

print(name)

#output

[1] “PULKIT JAIN

#creating age variable

age=19

print(age)

#output

[1] 19

#printing both the values together

paste(name, age)

#output

[1] "PULKIT JAIN 19"

PAGE \* MERGEFORMAT 2
PRACTICAL NO. 3`

Write an R program to include all data types.

#Create a numeric vector


b=c(2,3,5,7,9)
print(b)
#output
[1] 2 3 5 7 9

#Create a complex vector


x=c(0+0i+0+0i+0+0i)
print(x)
#output
[1] 0+0i

#Create a logical vector


z=c(TRUE, FALSE, TRUE, FALSE, TRUE, FALSE)
print(z)
#output
[1] TRUE FALSE TRUE FALSE TRUE FALSE

#create a character vector


k=c("apple","cherry","blueberry","orange")
print(k)
#output
[1] "apple" "cherry" "blueberry" "orange"

PAGE \* MERGEFORMAT 2
PRACTICAL NO. 4
Write a program to illustrate the usage of all arithmetic, logical and relational operators
with two vectors.

#arithmetic operator.
vect1=c(0,2)
vect2=c(3,6)

paste("Addition")
[1] "Addition"
a=vect1+vect2
print(a)
#output
[1] 3 8
paste("Subtraction")
[1] "Subtraction"
b=vect1-vect2
print(b)

#output
[1] -3 -4
paste("Multiplication")
[1] "Multiplication"
c=vect1*vect2
print(c)

PAGE \* MERGEFORMAT 2
#output
[1] 0 12
paste("Division")
[1] 0 12
d=vect1/vect2
print(d)
#output
[1] 0.0000000 0.3333333

# Relational operator
vect1=c(0,2)

vect2=c(2,3)

Equal

print(paste("Equal",vect1==vect2))

Output

[1] "Equal FALSE" "Equal FALSE"

Not Equal

print(paste("Not Equal",vect1=vect2))

Output

[1] "Not Equal 2" "Not Equal 3"

Greater than(>)

print(paste("Greater than",vect1>vect2))

PAGE \* MERGEFORMAT 2
Output

[1] "Greater than FALSE" "Greater than FALSE"

Less than(<)

print(paste("Less than”, vect1<vect2))

Output

[1] "Less than TRUE" "Less than TRUE"

#Logical operators

vect3=c(10,20,30,40,50)

vect4=c(5,10,15,20,25)

AND

print(paste("AND”, (vect3>20) &(vect4<20)))

Output

[1] "AND FALSE" "AND FALSE" "AND TRUE” “AND FALSE" "AND FALSE"

OR

print (paste ("OR”, (vect3>20)/(vect4<20)))

Output

[1] "OR 0" "OR 0" "OR 1" "OR Inf" "OR Inf"

NOT

print(paste("NOT”, (vect3>20)))

Output

PAGE \* MERGEFORMAT 2
[1] "NOT FALSE" "NOT FALSE" "NOT TRUE” “NOT TRUE” “NOT TRUE

PRACTICAL NO. 5

Write a R program to find out the descriptive statistics value of numeric vector through
specified length of 5.

# Create a numeric vector of length 5.


x=c(20,40,60,80,100)

# Calculate descriptive statistics


#Mean
mean(x)
#output
[1] 60

#Median
median(x)
#output
[1] 60

#Minimum
min(x)
#output
[1] 20

#Maximum
max(x)
#outpu
[1] 100
#Sum

PAGE \* MERGEFORMAT 2
sum(x)
#output
[1] 300

#Lenth
length(x)
#output
[1] 5

PAGE \* MERGEFORMAT 2
PRACTCIAL NO. 6
Write a R program to create a matrix of both numeric and character to assess and modify.

# Create a matrix in numeric

a=c(1,2,3,4,5,6,7,8,9)

matrix1=matrix(a,nrow=3,ncol=3,byrow=TRUE)

#Accessing the element

matrix1[2,2]

[1] 5

print(matrix1)

Output

[,1] [,2] [,3]

[1,] 1 2 3

[2,] 4 5 6

[3,] 7 8 9

paste("new matrix:”, matrix1)

[1] "new matrix: 1" "new matrix: 4" "new matrix: 7" "new matrix: 2"

[5] "new matrix: 5" "new matrix: 8" "new matrix: 3" "new matrix: 6"

[9] "new matrix: 9"

PAGE \* MERGEFORMAT 2
#Modifying the element

matrix1[2,2] =100

print(matrix1)

Output

[,1] [,2] [,3]

[1,] 1 2 3

[2,] 4 100 6

[3,] 7 8 9

#Create a matrix in character. a=matrix(c("A","B","C","D","E","F","G","H","I"), nrow=3,


ncol=3, byrow=TRUE)

print(a)

Output

[,1] [,2] [,3]

[1,] "A” “B” “C"

[2,] "D” “E” “F"

[3,] "G” “H” “I"

#Accessing the Specific element

print (a [2,3])

PAGE \* MERGEFORMAT 2
Output

[1] "F"

#Modifying the Specific element.

a [1,1] <-"x"

a [2,3] <-"y"

print(a)

Output

[,1] [,2] [,3]

[1,] "x” “B” “C"

[2,] "D” “E” “y"

[3,] "G” “H” “I"

PAGE \* MERGEFORMAT 2
PRACTICAL NO.7

Write a R program to Create a list using Numeric and Character vectors in R. Access and
modify it also and merge also.

#creating a numeric list

list=list (6,7,9)

print(list)

#output

[[1]]

[1] 6

[[2]]

[1] 7

[[3]]

[1] 9

#access

list [2]

#output

[[1]]

[1] 7

PAGE \* MERGEFORMAT 2
[2] #Modify

list [3] =1

print(list)

#output

[[1]]

[1] 6

[[2]]

[1] 7

[[3]]

[1] 1

#creating a character list

list1=list("tom","ram","Rohan")

print(list1)

#output

[[1]]

[1] "tom"

[[2]]

[1] "ram"

[[3]]

[1] "rohan"

PAGE \* MERGEFORMAT 2
#access

list1[1]

#output

[[1]]

[1] "tom"

#modify

list1[3]="jerry"

print(list1)

#output

[[1]]

[1] "tom"

[[2]]

[1] "ram"

[[3]]

[1] "jerry"

#merging two list

list2=c(list,list1)

print(list2)

#output

[[1]]

[1] 6

[[2]]

PAGE \* MERGEFORMAT 2
[1] 7

[[3]]

[1] 1

[[4]]

[1] "tom"

[[5]]

[1] "ram”

[[6]]

[1] "jerry"

PAGE \* MERGEFORMAT 2
PRACTICAL NO. 8

Write a R program to create a data frame, merge two data frames also.

#creating a data frame

frame=data. frame(name=c("Rohit","Naman","Shreya"), age=c (18,19,20),


gender=c("male","male","female"))

print(frame)

#output

name age gender

1 Rohit 18 male

2 Naman 19 male

3 Shreya 20 female

#creating a new frame

frame1=data.frame(course=c("BBA","BJMC","BCA"), year=c (1,1,3), SGPA=c (6.2,8.9,7.8))

print(frame1)

#output

course year SGPA

1 BBA 1 6.2

2 BJMC 1 8.9

3 BCA 3 7.8

PAGE \* MERGEFORMAT 2
#merging frames together

frame3=cbind(frame, frame1)

print(frame3)

#output

name age gender course year SGPA

1 Rohit 18 male BBA 1 6.2

2 Naman 19 male BJMC 1 8.9

3 Shreya 20 female BCA 3 7.8

PAGE \* MERGEFORMAT 2
PRACTICAL NO. 9

Write a R program for loop statement such as if, else if, for and while and break statement.

#Check whether the value of x is positive, negative or zero.

X=0

if(x<0){

print(x)

if(x<0){

Print(x” is a negative number”)

} else if(x>0){

Print(x,”is a positive number”)

}else{

Print(“Zero”)

Output

[1]”Zero

#for loop statement

x=letters[4:10]

for(i in x) {print(i)}

[1] "d"

[1] "e"

PAGE \* MERGEFORMAT 2
[1] "f"

[1] "g"

[1] "h"

[1] "i"

[1] "j"

#while loop statement

x=1

#print 1 to 5

while (x<=4) { print (x)

+ x= x+1 }

Output

[1] 1

[1] 2

[1] 3

[1] 4

#Repeat loop and break statement

x=1

#print 1 to 5

repeat {

+ print(x)

+ x= x+1

+ if(x>5){

+ break

PAGE \* MERGEFORMAT 2
+ }

+ }

#Output

[1] 1

[1] 2

[1] 3

[1] 4

[1] 5

PAGE \* MERGEFORMAT 2
GOOGLE FORM

PAGE \* MERGEFORMAT 2
PAGE \* MERGEFORMAT 2
PAGE \* MERGEFORMAT 2
PAGE \* MERGEFORMAT 2
PAGE \* MERGEFORMAT 2
GOOGLE FORM RESPONSES

PAGE \* MERGEFORMAT 2
PAGE \* MERGEFORMAT 2
PAGE \* MERGEFORMAT 2
PAGE \* MERGEFORMAT 2
PAGE \* MERGEFORMAT 2
PAGE \* MERGEFORMAT 2
PAGE \* MERGEFORMAT 2

You might also like