Question What are the Mean , max , sum and median of the participants in the survey?
library(readr)
data <- read_csv("D:/social media.csv")
## Rows: 1628 Columns: 26
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (9): City, Current Status, Do you own multiple profiles on Instagram?, ...
## dbl (3): Age, Latitude, Longitude
## num (14): How many followers do you have on Instagram? (In case of multiple ...
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
View(data)
str(data)
## spc_tbl_ [1,628 × 26] (S3: spec_tbl_df/tbl_df/tbl/data.frame)
## $ Age : num [1:1628] 24 39 22 26 50 25 52 45 25 27 ...
## $ City : chr [1:1628] "Delhi" "Delhi" "Mumbai" "Bengaluru" ...
## $ Current Status : chr [1:1628] "Working professional" "Working professional" "Working professional" "Sabbatical" ...
## $ Do you own multiple profiles on Instagram? : chr [1:1628] "No" "No" "No" "Yes" ...
## $ Gender : chr [1:1628] "Female" "Female" "Male" "Female" ...
## $ Highest Education : chr [1:1628] "Graduation" "Post graduation" "Graduation" "Graduation" ...
## $ Location (City Airport Code) : chr [1:1628] "DEL" "DEL" "BOM" "BLR" ...
## $ Phone OS : chr [1:1628] "iOs" "iOs" "Android" "Android" ...
## $ State : chr [1:1628] "Delhi" "Delhi" "Maharashtra" "Karnataka" ...
## $ Zone : chr [1:1628] "Northern" "Northern" "Western" "Southern" ...
## $ How many followers do you have on Instagram? (In case of multiple accounts, please mention the one with the maximum): num [1:1628] 456 0 400 485 0 ...
## $ How many posts do you have on Instagram? : num [1:1628] 20 0 6 16 0 220 0 0 340 37 ...
## $ Latitude : num [1:1628] 28.7 28.7 19 13 28.7 ...
## $ Longitude : num [1:1628] 77.2 77.2 72.8 77.6 77.2 ...
## $ Time Spent on Facebook in last week (in minutes) : num [1:1628] 0 6000 500 1500 1500 1000 300 983 1160 480 ...
## $ Time Spent on Facebook in last weekend (in minutes) : num [1:1628] 0 2160 2000 1500 1500 1200 900 873 870 840 ...
## $ Time Spent on Instagram in last week (in minutes) : num [1:1628] 770 0 1000 2000 0 3000 0 0 1240 720 ...
## $ Time Spent on Instagram in last weekend (in minutes) : num [1:1628] 400 0 1000 2000 0 840 215 0 340 300 ...
## $ Time Spent on WhatsApp in last week (in minutes) : num [1:1628] 900 5000 7000 1680 2400 2100 1800 583 1760 3000 ...
## $ Time Spent on WhatsApp in last weekend (in minutes) : num [1:1628] 120 2000 2000 1680 1300 600 1500 834 450 600 ...
## $ Total Facebook Usage : num [1:1628] 0 8160 2500 3000 3000 ...
## $ Total Instagram Usage : num [1:1628] 1170 0 2000 4000 0 3840 215 0 1580 1020 ...
## $ Total Social Media Usage : num [1:1628] 2190 15160 13500 10360 6700 ...
## $ Total Week Usage : num [1:1628] 1670 11000 8500 5180 3900 ...
## $ Total Weekend Usage : num [1:1628] 520 4160 5000 5180 2800 ...
## $ Total WhatsApp Usage : num [1:1628] 1020 7000 9000 3360 3700 ...
## - attr(*, "spec")=
## .. cols(
## .. Age = col_double(),
## .. City = col_character(),
## .. `Current Status` = col_character(),
## .. `Do you own multiple profiles on Instagram?` = col_character(),
## .. Gender = col_character(),
## .. `Highest Education` = col_character(),
## .. `Location (City Airport Code)` = col_character(),
## .. `Phone OS` = col_character(),
## .. State = col_character(),
## .. Zone = col_character(),
## .. `How many followers do you have on Instagram? (In case of multiple accounts, please mention the one with the maximum)` = col_number(),
## .. `How many posts do you have on Instagram?` = col_number(),
## .. Latitude = col_double(),
## .. Longitude = col_double(),
## .. `Time Spent on Facebook in last week (in minutes)` = col_number(),
## .. `Time Spent on Facebook in last weekend (in minutes)` = col_number(),
## .. `Time Spent on Instagram in last week (in minutes)` = col_number(),
## .. `Time Spent on Instagram in last weekend (in minutes)` = col_number(),
## .. `Time Spent on WhatsApp in last week (in minutes)` = col_number(),
## .. `Time Spent on WhatsApp in last weekend (in minutes)` = col_number(),
## .. `Total Facebook Usage` = col_number(),
## .. `Total Instagram Usage` = col_number(),
## .. `Total Social Media Usage` = col_number(),
## .. `Total Week Usage` = col_number(),
## .. `Total Weekend Usage` = col_number(),
## .. `Total WhatsApp Usage` = col_number()
## .. )
## - attr(*, "problems")=<externalptr>
summary(data)
## Age City Current Status
## Min. :13.00 Length:1628 Length:1628
## 1st Qu.:22.00 Class :character Class :character
## Median :24.00 Mode :character Mode :character
## Mean :26.86
## 3rd Qu.:27.00
## Max. :74.00
## Do you own multiple profiles on Instagram? Gender
## Length:1628 Length:1628
## Class :character Class :character
## Mode :character Mode :character
##
##
##
## Highest Education Location (City Airport Code) Phone OS
## Length:1628 Length:1628 Length:1628
## Class :character Class :character Class :character
## Mode :character Mode :character Mode :character
##
##
##
## State Zone
## Length:1628 Length:1628
## Class :character Class :character
## Mode :character Mode :character
##
##
##
## How many followers do you have on Instagram? (In case of multiple accounts, please mention the one with the maximum)
## Min. : 0.0
## 1st Qu.: 183.0
## Median : 370.0
## Mean : 868.1
## 3rd Qu.: 657.0
## Max. :116000.0
## How many posts do you have on Instagram? Latitude Longitude
## Min. : 0.00 Min. : 8.486 Min. :69.67
## 1st Qu.: 10.00 1st Qu.:18.988 1st Qu.:72.84
## Median : 43.50 Median :22.563 Median :77.23
## Mean : 99.08 Mean :22.760 Mean :77.89
## 3rd Qu.: 111.25 3rd Qu.:28.652 3rd Qu.:78.46
## Max. :2858.00 Max. :32.736 Max. :94.91
## Time Spent on Facebook in last week (in minutes)
## Min. : 0.0
## 1st Qu.: 2.0
## Median : 63.0
## Mean : 175.2
## 3rd Qu.: 240.0
## Max. :6000.0
## Time Spent on Facebook in last weekend (in minutes)
## Min. : 0.00
## 1st Qu.: 0.00
## Median : 30.00
## Mean : 75.69
## 3rd Qu.: 89.00
## Max. :2160.00
## Time Spent on Instagram in last week (in minutes)
## Min. : 0.0
## 1st Qu.: 120.0
## Median : 357.0
## Mean : 505.2
## 3rd Qu.: 675.0
## Max. :6000.0
## Time Spent on Instagram in last weekend (in minutes)
## Min. : 0.0
## 1st Qu.: 48.0
## Median : 135.0
## Mean : 215.0
## 3rd Qu.: 281.5
## Max. :2560.0
## Time Spent on WhatsApp in last week (in minutes)
## Min. : 4.0
## 1st Qu.: 300.0
## Median : 600.0
## Mean : 854.9
## 3rd Qu.:1009.0
## Max. :7000.0
## Time Spent on WhatsApp in last weekend (in minutes) Total Facebook Usage
## Min. : 0.0 Min. : 0.0
## 1st Qu.: 100.0 1st Qu.: 10.0
## Median : 200.0 Median : 101.5
## Mean : 294.9 Mean : 250.9
## 3rd Qu.: 360.0 3rd Qu.: 334.2
## Max. :2800.0 Max. :8160.0
## Total Instagram Usage Total Social Media Usage Total Week Usage
## Min. : 0.0 Min. : 12 Min. : 8
## 1st Qu.: 190.8 1st Qu.: 970 1st Qu.: 670
## Median : 522.5 Median : 1658 Median : 1170
## Mean : 720.2 Mean : 2121 Mean : 1535
## 3rd Qu.: 970.0 3rd Qu.: 2670 3rd Qu.: 1895
## Max. :8240.0 Max. :15780 Max. :12734
## Total Weekend Usage Total WhatsApp Usage
## Min. : 0.0 Min. : 9
## 1st Qu.: 243.0 1st Qu.: 450
## Median : 425.5 Median : 812
## Mean : 585.6 Mean :1150
## 3rd Qu.: 709.0 3rd Qu.:1400
## Max. :5180.0 Max. :9000
#Average age
mean(data$Age)
## [1] 26.85811
# Median age
median(data$Age)
## [1] 24
# Maximum age
max(data$Age)
## [1] 74
# Minimum age
min(data$Age)
## [1] 13
# Total number of males
sum(data$Gender == "Male")
## [1] 813
# Total number of females
sum(data$Gender == "Female")
## [1] 813
# Average number of followers on Instagram
mean(data$`How many followers do you have on Instagram? (In case of multiple accounts, please mention the one with the maximum)`)
## [1] 868.1474
# Median number of followers on Instagram
median(data$`How many followers do you have on Instagram? (In case of multiple accounts, please mention the one with the maximum)`)
## [1] 370
# Maximum number of followers on Instagram
max(data$`How many followers do you have on Instagram? (In case of multiple accounts, please mention the one with the maximum)`)
## [1] 116000
# Minimum number of followers on Instagram
min(data$`How many followers do you have on Instagram? (In case of multiple accounts, please mention the one with the maximum)`)
## [1] 0
# Average number of posts on Instagram
mean(data$`How many posts do you have on Instagram?`)
## [1] 99.07985
# Median number of posts on Instagram
median(data$`How many posts do you have on Instagram?`)
## [1] 43.5
# Maximum number of posts on Instagram
max(data$`How many posts do you have on Instagram?`)
## [1] 2858
# Minimum number of posts on Instagram
min(data$`How many posts do you have on Instagram?`)
## [1] 0
# Total time spent on Facebook in last week
sum(data$`Time Spent on Facebook in last week (in minutes)`)
## [1] 285275
# Total time spent on Instagram in last week
sum(data$`Time Spent on Instagram in last week (in minutes)`)
## [1] 822407
# Total time spent on WhatsApp in last week
sum(data$`Time Spent on WhatsApp in last week (in minutes)`)
## [1] 1391726
# Create a matrix with the first 3 rows and 3 columns of the data
matrix_data <- matrix(data[1:3, 1:3], nrow = 3, ncol = 3, byrow = TRUE)
# Print the matrix
matrix_data
## [,1] [,2] [,3]
## [1,] numeric,3 character,3 character,3
## [2,] numeric,3 character,3 character,3
## [3,] numeric,3 character,3 character,3
# Average total social media usage
mean(data$`Total Social Media Usage`)
## [1] 2120.885
# Median total social media usage
median(data$`Total Social Media Usage`)
## [1] 1658.5
# Maximum total social media usage
max(data$`Total Social Media Usage`)
## [1] 15780
summary(data$Age)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 13.00 22.00 24.00 26.86 27.00 74.00
summary(data$`Total Social Media Usage`)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 12 970 1658 2121 2670 15780
head(data)
## # A tibble: 6 × 26
## Age City `Current Status` Do you own multiple …¹ Gender `Highest Education`
## <dbl> <chr> <chr> <chr> <chr> <chr>
## 1 24 Delhi Working profess… No Female Graduation
## 2 39 Delhi Working profess… No Female Post graduation
## 3 22 Mumb… Working profess… No Male Graduation
## 4 26 Beng… Sabbatical Yes Female Graduation
## 5 50 Delhi Working profess… No Male Graduation
## 6 25 Vish… Working profess… Yes Female Post graduation
## # ℹ abbreviated name: ¹`Do you own multiple profiles on Instagram?`
## # ℹ 20 more variables: `Location (City Airport Code)` <chr>, `Phone OS` <chr>,
## # State <chr>, Zone <chr>,
## # `How many followers do you have on Instagram? (In case of multiple accounts, please mention the one with the maximum)` <dbl>,
## # `How many posts do you have on Instagram?` <dbl>, Latitude <dbl>,
## # Longitude <dbl>, `Time Spent on Facebook in last week (in minutes)` <dbl>,
## # `Time Spent on Facebook in last weekend (in minutes)` <dbl>, …
tail(data)
## # A tibble: 6 × 26
## Age City `Current Status` Do you own multiple …¹ Gender `Highest Education`
## <dbl> <chr> <chr> <chr> <chr> <chr>
## 1 24 Vara… Sabbatical Yes Male Post graduation
## 2 24 Delhi Student Yes Male Post graduation
## 3 24 Kolk… Working profess… Yes Male Post graduation
## 4 24 Ludh… Working profess… Yes Male Post graduation
## 5 35 Mumb… Working profess… Yes Male Post graduation
## 6 26 Beng… Working profess… Yes Non B… Post graduation
## # ℹ abbreviated name: ¹`Do you own multiple profiles on Instagram?`
## # ℹ 20 more variables: `Location (City Airport Code)` <chr>, `Phone OS` <chr>,
## # State <chr>, Zone <chr>,
## # `How many followers do you have on Instagram? (In case of multiple accounts, please mention the one with the maximum)` <dbl>,
## # `How many posts do you have on Instagram?` <dbl>, Latitude <dbl>,
## # Longitude <dbl>, `Time Spent on Facebook in last week (in minutes)` <dbl>,
## # `Time Spent on Facebook in last weekend (in minutes)` <dbl>, …
Question What are the different ways in which the data has been filtered based on various conditions such as gender, education, location, phone OS, and social media usage?“
# Only females
females <- subset(data, Gender == "Female")
females
## # A tibble: 813 × 26
## Age City `Current Status` Do you own multiple profil…¹ Gender
## <dbl> <chr> <chr> <chr> <chr>
## 1 24 Delhi Working professional No Female
## 2 39 Delhi Working professional No Female
## 3 26 Bengaluru Sabbatical Yes Female
## 4 25 Vishakhapatnam Working professional Yes Female
## 5 45 Durgapur Sabbatical No Female
## 6 45 Delhi Working professional No Female
## 7 21 Delhi Working professional No Female
## 8 26 Delhi Working professional No Female
## 9 25 Mumbai Sabbatical No Female
## 10 22 Kolkata Student No Female
## # ℹ 803 more rows
## # ℹ abbreviated name: ¹`Do you own multiple profiles on Instagram?`
## # ℹ 21 more variables: `Highest Education` <chr>,
## # `Location (City Airport Code)` <chr>, `Phone OS` <chr>, State <chr>,
## # Zone <chr>,
## # `How many followers do you have on Instagram? (In case of multiple accounts, please mention the one with the maximum)` <dbl>,
## # `How many posts do you have on Instagram?` <dbl>, Latitude <dbl>, …
# Only males
males <- subset(data, Gender == "Male")
males
## # A tibble: 813 × 26
## Age City `Current Status` Do you own multiple profiles on…¹ Gender
## <dbl> <chr> <chr> <chr> <chr>
## 1 22 Mumbai Working professional No Male
## 2 50 Delhi Working professional No Male
## 3 52 Jaipur Working professional No Male
## 4 25 Bengaluru Student No Male
## 5 27 Delhi Student Yes Male
## 6 27 Bengaluru Working professional No Male
## 7 22 Delhi Sabbatical Yes Male
## 8 26 Agra Working professional No Male
## 9 25 Ahmedabad Student No Male
## 10 18 Jaipur Student No Male
## # ℹ 803 more rows
## # ℹ abbreviated name: ¹`Do you own multiple profiles on Instagram?`
## # ℹ 21 more variables: `Highest Education` <chr>,
## # `Location (City Airport Code)` <chr>, `Phone OS` <chr>, State <chr>,
## # Zone <chr>,
## # `How many followers do you have on Instagram? (In case of multiple accounts, please mention the one with the maximum)` <dbl>,
## # `How many posts do you have on Instagram?` <dbl>, Latitude <dbl>, …
# Only students
students <- subset(data, `Current Status` == "Student")
students
## # A tibble: 637 × 26
## Age City `Current Status` Do you own multiple profiles on Ins…¹ Gender
## <dbl> <chr> <chr> <chr> <chr>
## 1 25 Bengaluru Student No Male
## 2 27 Delhi Student Yes Male
## 3 25 Ahmedabad Student No Male
## 4 18 Jaipur Student No Male
## 5 22 Kolkata Student No Female
## 6 26 Kolkata Student No Female
## 7 23 Delhi Student No Female
## 8 17 Mumbai Student Yes Male
## 9 23 Kolkata Student Yes Female
## 10 22 Ahmedabad Student No Male
## # ℹ 627 more rows
## # ℹ abbreviated name: ¹`Do you own multiple profiles on Instagram?`
## # ℹ 21 more variables: `Highest Education` <chr>,
## # `Location (City Airport Code)` <chr>, `Phone OS` <chr>, State <chr>,
## # Zone <chr>,
## # `How many followers do you have on Instagram? (In case of multiple accounts, please mention the one with the maximum)` <dbl>,
## # `How many posts do you have on Instagram?` <dbl>, Latitude <dbl>, …
# Only working professionals
working_professionals <- subset(data, `Current Status` == "Working professional")
working_professionals
## # A tibble: 796 × 26
## Age City `Current Status` Do you own multiple profil…¹ Gender
## <dbl> <chr> <chr> <chr> <chr>
## 1 24 Delhi Working professional No Female
## 2 39 Delhi Working professional No Female
## 3 22 Mumbai Working professional No Male
## 4 50 Delhi Working professional No Male
## 5 25 Vishakhapatnam Working professional Yes Female
## 6 52 Jaipur Working professional No Male
## 7 27 Bengaluru Working professional No Male
## 8 45 Delhi Working professional No Female
## 9 21 Delhi Working professional No Female
## 10 26 Agra Working professional No Male
## # ℹ 786 more rows
## # ℹ abbreviated name: ¹`Do you own multiple profiles on Instagram?`
## # ℹ 21 more variables: `Highest Education` <chr>,
## # `Location (City Airport Code)` <chr>, `Phone OS` <chr>, State <chr>,
## # Zone <chr>,
## # `How many followers do you have on Instagram? (In case of multiple accounts, please mention the one with the maximum)` <dbl>,
## # `How many posts do you have on Instagram?` <dbl>, Latitude <dbl>, …
# Only people from Northern zone
northern <- subset(data, Zone == "Northern")
northern
## # A tibble: 542 × 26
## Age City `Current Status` Do you own multiple profiles on In…¹ Gender
## <dbl> <chr> <chr> <chr> <chr>
## 1 24 Delhi Working professional No Female
## 2 39 Delhi Working professional No Female
## 3 50 Delhi Working professional No Male
## 4 52 Jaipur Working professional No Male
## 5 27 Delhi Student Yes Male
## 6 45 Delhi Working professional No Female
## 7 22 Delhi Sabbatical Yes Male
## 8 21 Delhi Working professional No Female
## 9 26 Agra Working professional No Male
## 10 26 Delhi Working professional No Female
## # ℹ 532 more rows
## # ℹ abbreviated name: ¹`Do you own multiple profiles on Instagram?`
## # ℹ 21 more variables: `Highest Education` <chr>,
## # `Location (City Airport Code)` <chr>, `Phone OS` <chr>, State <chr>,
## # Zone <chr>,
## # `How many followers do you have on Instagram? (In case of multiple accounts, please mention the one with the maximum)` <dbl>,
## # `How many posts do you have on Instagram?` <dbl>, Latitude <dbl>, …
# Only people from Southern zone
southern <- subset(data, Zone == "Southern")
southern
## # A tibble: 211 × 26
## Age City `Current Status` Do you own multiple profil…¹ Gender
## <dbl> <chr> <chr> <chr> <chr>
## 1 26 Bengaluru Sabbatical Yes Female
## 2 25 Vishakhapatnam Working professional Yes Female
## 3 25 Bengaluru Student No Male
## 4 27 Bengaluru Working professional No Male
## 5 32 Bengaluru Working professional No Male
## 6 27 Chennai Working professional No Male
## 7 23 Chennai Student No Female
## 8 22 Chennai Student Yes Female
## 9 32 Bengaluru Working professional No Female
## 10 21 Chennai Student No Female
## # ℹ 201 more rows
## # ℹ abbreviated name: ¹`Do you own multiple profiles on Instagram?`
## # ℹ 21 more variables: `Highest Education` <chr>,
## # `Location (City Airport Code)` <chr>, `Phone OS` <chr>, State <chr>,
## # Zone <chr>,
## # `How many followers do you have on Instagram? (In case of multiple accounts, please mention the one with the maximum)` <dbl>,
## # `How many posts do you have on Instagram?` <dbl>, Latitude <dbl>, …
# Only people from Eastern zone
eastern <- subset(data, Zone == "Eastern")
eastern
## # A tibble: 271 × 26
## Age City `Current Status` Do you own multiple profiles …¹ Gender
## <dbl> <chr> <chr> <chr> <chr>
## 1 45 Durgapur Sabbatical No Female
## 2 24 Cooch-behar Working professional No Male
## 3 22 Kolkata Student No Female
## 4 26 Kolkata Student No Female
## 5 50 Kolkata Working professional No Female
## 6 23 Kolkata Student Yes Female
## 7 25 Kolkata Working professional No Male
## 8 45 Bagdogra Working professional Yes Female
## 9 25 Kolkata Student No Male
## 10 45 Kolkata Working professional No Female
## # ℹ 261 more rows
## # ℹ abbreviated name: ¹`Do you own multiple profiles on Instagram?`
## # ℹ 21 more variables: `Highest Education` <chr>,
## # `Location (City Airport Code)` <chr>, `Phone OS` <chr>, State <chr>,
## # Zone <chr>,
## # `How many followers do you have on Instagram? (In case of multiple accounts, please mention the one with the maximum)` <dbl>,
## # `How many posts do you have on Instagram?` <dbl>, Latitude <dbl>, …
# Only people from Western zone
western <- subset(data, Zone == "Western")
western
## # A tibble: 543 × 26
## Age City `Current Status` Do you own multiple profiles on…¹ Gender
## <dbl> <chr> <chr> <chr> <chr>
## 1 22 Mumbai Working professional No Male
## 2 25 Ahmedabad Student No Male
## 3 25 Mumbai Sabbatical No Female
## 4 25 Ahmedabad Self Employed Yes Male
## 5 17 Mumbai Student Yes Male
## 6 22 Ahmedabad Student No Male
## 7 24 Pune Working professional No Female
## 8 21 Mumbai Sabbatical Yes Female
## 9 51 Ahmedabad Working professional No Male
## 10 22 Mumbai Sabbatical No Male
## # ℹ 533 more rows
## # ℹ abbreviated name: ¹`Do you own multiple profiles on Instagram?`
## # ℹ 21 more variables: `Highest Education` <chr>,
## # `Location (City Airport Code)` <chr>, `Phone OS` <chr>, State <chr>,
## # Zone <chr>,
## # `How many followers do you have on Instagram? (In case of multiple accounts, please mention the one with the maximum)` <dbl>,
## # `How many posts do you have on Instagram?` <dbl>, Latitude <dbl>, …
#Only people with Android phone OS
android <- subset(data, `Phone OS` == "Android")
android
## # A tibble: 1,115 × 26
## Age City `Current Status` Do you own multiple profil…¹ Gender
## <dbl> <chr> <chr> <chr> <chr>
## 1 22 Mumbai Working professional No Male
## 2 26 Bengaluru Sabbatical Yes Female
## 3 25 Vishakhapatnam Working professional Yes Female
## 4 52 Jaipur Working professional No Male
## 5 45 Durgapur Sabbatical No Female
## 6 25 Bengaluru Student No Male
## 7 27 Delhi Student Yes Male
## 8 27 Bengaluru Working professional No Male
## 9 21 Delhi Working professional No Female
## 10 26 Agra Working professional No Male
## # ℹ 1,105 more rows
## # ℹ abbreviated name: ¹`Do you own multiple profiles on Instagram?`
## # ℹ 21 more variables: `Highest Education` <chr>,
## # `Location (City Airport Code)` <chr>, `Phone OS` <chr>, State <chr>,
## # Zone <chr>,
## # `How many followers do you have on Instagram? (In case of multiple accounts, please mention the one with the maximum)` <dbl>,
## # `How many posts do you have on Instagram?` <dbl>, Latitude <dbl>, …
# Only people with iOs phone OS
ios <- subset(data, `Phone OS` == "iOs")
ios
## # A tibble: 508 × 26
## Age City `Current Status` Do you own multiple profiles on …¹ Gender
## <dbl> <chr> <chr> <chr> <chr>
## 1 24 Delhi Working professional No Female
## 2 39 Delhi Working professional No Female
## 3 50 Delhi Working professional No Male
## 4 45 Delhi Working professional No Female
## 5 22 Delhi Sabbatical Yes Male
## 6 18 Jaipur Student No Male
## 7 22 Chennai Student Yes Female
## 8 23 Guwahati Student No Female
## 9 45 Bagdogra Working professional Yes Female
## 10 28 Kolkata Sabbatical No Female
## # ℹ 498 more rows
## # ℹ abbreviated name: ¹`Do you own multiple profiles on Instagram?`
## # ℹ 21 more variables: `Highest Education` <chr>,
## # `Location (City Airport Code)` <chr>, `Phone OS` <chr>, State <chr>,
## # Zone <chr>,
## # `How many followers do you have on Instagram? (In case of multiple accounts, please mention the one with the maximum)` <dbl>,
## # `How many posts do you have on Instagram?` <dbl>, Latitude <dbl>, …
#Only people with Graduation education
graduation <- subset(data, `Highest Education` == "Graduation")
graduation
## # A tibble: 950 × 26
## Age City `Current Status` Do you own multiple profiles on…¹ Gender
## <dbl> <chr> <chr> <chr> <chr>
## 1 24 Delhi Working professional No Female
## 2 22 Mumbai Working professional No Male
## 3 26 Bengaluru Sabbatical Yes Female
## 4 50 Delhi Working professional No Male
## 5 45 Durgapur Sabbatical No Female
## 6 25 Bengaluru Student No Male
## 7 27 Delhi Student Yes Male
## 8 27 Bengaluru Working professional No Male
## 9 45 Delhi Working professional No Female
## 10 21 Delhi Working professional No Female
## # ℹ 940 more rows
## # ℹ abbreviated name: ¹`Do you own multiple profiles on Instagram?`
## # ℹ 21 more variables: `Highest Education` <chr>,
## # `Location (City Airport Code)` <chr>, `Phone OS` <chr>, State <chr>,
## # Zone <chr>,
## # `How many followers do you have on Instagram? (In case of multiple accounts, please mention the one with the maximum)` <dbl>,
## # `How many posts do you have on Instagram?` <dbl>, Latitude <dbl>, …
#Only people with Post graduation education
post_graduation <- subset(data, `Highest Education` == "Post graduation")
post_graduation
## # A tibble: 541 × 26
## Age City `Current Status` Do you own multiple profil…¹ Gender
## <dbl> <chr> <chr> <chr> <chr>
## 1 39 Delhi Working professional No Female
## 2 25 Vishakhapatnam Working professional Yes Female
## 3 52 Jaipur Working professional No Male
## 4 22 Delhi Sabbatical Yes Male
## 5 26 Delhi Working professional No Female
## 6 25 Mumbai Sabbatical No Female
## 7 22 Kolkata Student No Female
## 8 26 Kolkata Student No Female
## 9 27 Chennai Working professional No Male
## 10 32 Bengaluru Working professional No Female
## # ℹ 531 more rows
## # ℹ abbreviated name: ¹`Do you own multiple profiles on Instagram?`
## # ℹ 21 more variables: `Highest Education` <chr>,
## # `Location (City Airport Code)` <chr>, `Phone OS` <chr>, State <chr>,
## # Zone <chr>,
## # `How many followers do you have on Instagram? (In case of multiple accounts, please mention the one with the maximum)` <dbl>,
## # `How many posts do you have on Instagram?` <dbl>, Latitude <dbl>, …
#Only people with High School education
high_school <- subset(data, `Highest Education` == "High School")
high_school
## # A tibble: 137 × 26
## Age City `Current Status` Do you own multiple profiles on…¹ Gender
## <dbl> <chr> <chr> <chr> <chr>
## 1 18 Jaipur Student No Male
## 2 35 Delhi Working professional Yes Female
## 3 23 Delhi Student No Female
## 4 50 Kolkata Working professional No Female
## 5 17 Mumbai Student Yes Male
## 6 16 Kolkata Student No Male
## 7 16 Jaipur Student No Female
## 8 15 Chennai Student Yes Female
## 9 20 Hyderabad Student Yes Male
## 10 16 Mumbai Student No Male
## # ℹ 127 more rows
## # ℹ abbreviated name: ¹`Do you own multiple profiles on Instagram?`
## # ℹ 21 more variables: `Highest Education` <chr>,
## # `Location (City Airport Code)` <chr>, `Phone OS` <chr>, State <chr>,
## # Zone <chr>,
## # `How many followers do you have on Instagram? (In case of multiple accounts, please mention the one with the maximum)` <dbl>,
## # `How many posts do you have on Instagram?` <dbl>, Latitude <dbl>, …
#Only people with multiple profiles on Instagram
multiple_profiles <- subset(data, `Do you own multiple profiles on Instagram?` == "Yes")
multiple_profiles
## # A tibble: 308 × 26
## Age City `Current Status` Do you own multiple profil…¹ Gender
## <dbl> <chr> <chr> <chr> <chr>
## 1 26 Bengaluru Sabbatical Yes Female
## 2 25 Vishakhapatnam Working professional Yes Female
## 3 27 Delhi Student Yes Male
## 4 22 Delhi Sabbatical Yes Male
## 5 25 Ahmedabad Self Employed Yes Male
## 6 35 Delhi Working professional Yes Female
## 7 17 Mumbai Student Yes Male
## 8 23 Kolkata Student Yes Female
## 9 26 Kanpur Working professional Yes Male
## 10 22 Chennai Student Yes Female
## # ℹ 298 more rows
## # ℹ abbreviated name: ¹`Do you own multiple profiles on Instagram?`
## # ℹ 21 more variables: `Highest Education` <chr>,
## # `Location (City Airport Code)` <chr>, `Phone OS` <chr>, State <chr>,
## # Zone <chr>,
## # `How many followers do you have on Instagram? (In case of multiple accounts, please mention the one with the maximum)` <dbl>,
## # `How many posts do you have on Instagram?` <dbl>, Latitude <dbl>, …
#Only people who own a single profile on Instagram
single_profile <- subset(data, `Do you own multiple profiles on Instagram?` == "No")
single_profile
## # A tibble: 1,316 × 26
## Age City `Current Status` Do you own multiple profiles on…¹ Gender
## <dbl> <chr> <chr> <chr> <chr>
## 1 24 Delhi Working professional No Female
## 2 39 Delhi Working professional No Female
## 3 22 Mumbai Working professional No Male
## 4 50 Delhi Working professional No Male
## 5 52 Jaipur Working professional No Male
## 6 45 Durgapur Sabbatical No Female
## 7 25 Bengaluru Student No Male
## 8 27 Bengaluru Working professional No Male
## 9 45 Delhi Working professional No Female
## 10 21 Delhi Working professional No Female
## # ℹ 1,306 more rows
## # ℹ abbreviated name: ¹`Do you own multiple profiles on Instagram?`
## # ℹ 21 more variables: `Highest Education` <chr>,
## # `Location (City Airport Code)` <chr>, `Phone OS` <chr>, State <chr>,
## # Zone <chr>,
## # `How many followers do you have on Instagram? (In case of multiple accounts, please mention the one with the maximum)` <dbl>,
## # `How many posts do you have on Instagram?` <dbl>, Latitude <dbl>, …
#Only people who spent more than 500 minutes on Facebook in last week
more_than_500_fb <- subset(data, `Time Spent on Facebook in last week (in minutes)` > 500)
more_than_500_fb
## # A tibble: 130 × 26
## Age City `Current Status` Do you own multiple profil…¹ Gender
## <dbl> <chr> <chr> <chr> <chr>
## 1 39 Delhi Working professional No Female
## 2 26 Bengaluru Sabbatical Yes Female
## 3 50 Delhi Working professional No Male
## 4 25 Vishakhapatnam Working professional Yes Female
## 5 45 Durgapur Sabbatical No Female
## 6 25 Bengaluru Student No Male
## 7 27 Bengaluru Working professional No Male
## 8 22 Delhi Sabbatical Yes Male
## 9 18 Jaipur Student No Male
## 10 25 Mumbai Sabbatical No Female
## # ℹ 120 more rows
## # ℹ abbreviated name: ¹`Do you own multiple profiles on Instagram?`
## # ℹ 21 more variables: `Highest Education` <chr>,
## # `Location (City Airport Code)` <chr>, `Phone OS` <chr>, State <chr>,
## # Zone <chr>,
## # `How many followers do you have on Instagram? (In case of multiple accounts, please mention the one with the maximum)` <dbl>,
## # `How many posts do you have on Instagram?` <dbl>, Latitude <dbl>, …
#Only people who spent more than 500 minutes on Instagram in last week
more_than_500_insta <- subset(data, `Time Spent on Instagram in last week (in minutes)` > 500)
more_than_500_insta
## # A tibble: 559 × 26
## Age City `Current Status` Do you own multiple profil…¹ Gender
## <dbl> <chr> <chr> <chr> <chr>
## 1 24 Delhi Working professional No Female
## 2 22 Mumbai Working professional No Male
## 3 26 Bengaluru Sabbatical Yes Female
## 4 25 Vishakhapatnam Working professional Yes Female
## 5 25 Bengaluru Student No Male
## 6 27 Delhi Student Yes Male
## 7 45 Delhi Working professional No Female
## 8 22 Delhi Sabbatical Yes Male
## 9 18 Jaipur Student No Male
## 10 25 Mumbai Sabbatical No Female
## # ℹ 549 more rows
## # ℹ abbreviated name: ¹`Do you own multiple profiles on Instagram?`
## # ℹ 21 more variables: `Highest Education` <chr>,
## # `Location (City Airport Code)` <chr>, `Phone OS` <chr>, State <chr>,
## # Zone <chr>,
## # `How many followers do you have on Instagram? (In case of multiple accounts, please mention the one with the maximum)` <dbl>,
## # `How many posts do you have on Instagram?` <dbl>, Latitude <dbl>, …
#Only people who spent more than 500 minutes on WhatsApp in last week
more_than_500_whatsapp <- subset(data, `Time Spent on WhatsApp in last week (in minutes)` > 500)
more_than_500_whatsapp
## # A tibble: 913 × 26
## Age City `Current Status` Do you own multiple profil…¹ Gender
## <dbl> <chr> <chr> <chr> <chr>
## 1 24 Delhi Working professional No Female
## 2 39 Delhi Working professional No Female
## 3 22 Mumbai Working professional No Male
## 4 26 Bengaluru Sabbatical Yes Female
## 5 50 Delhi Working professional No Male
## 6 25 Vishakhapatnam Working professional Yes Female
## 7 52 Jaipur Working professional No Male
## 8 45 Durgapur Sabbatical No Female
## 9 25 Bengaluru Student No Male
## 10 27 Delhi Student Yes Male
## # ℹ 903 more rows
## # ℹ abbreviated name: ¹`Do you own multiple profiles on Instagram?`
## # ℹ 21 more variables: `Highest Education` <chr>,
## # `Location (City Airport Code)` <chr>, `Phone OS` <chr>, State <chr>,
## # Zone <chr>,
## # `How many followers do you have on Instagram? (In case of multiple accounts, please mention the one with the maximum)` <dbl>,
## # `How many posts do you have on Instagram?` <dbl>, Latitude <dbl>, …
#Only people who have more than 1000 followers on Instagram
more_than_1000_followers <- subset(data, `How many followers do you have on Instagram? (In case of multiple accounts, please mention the one with the maximum)` > 1000)
more_than_1000_followers
## # A tibble: 199 × 26
## Age City `Current Status` Do you own multiple profiles on…¹ Gender
## <dbl> <chr> <chr> <chr> <chr>
## 1 25 Bengaluru Student No Male
## 2 23 Kolkata Student Yes Female
## 3 21 Chennai Student No Female
## 4 21 Chennai Student Yes Female
## 5 21 Mumbai Sabbatical Yes Female
## 6 57 Delhi Sabbatical Yes Male
## 7 22 Delhi Student No Female
## 8 35 Mumbai Working professional Yes Female
## 9 26 Ahmedabad Working professional No Male
## 10 21 Mumbai Student No Female
## # ℹ 189 more rows
## # ℹ abbreviated name: ¹`Do you own multiple profiles on Instagram?`
## # ℹ 21 more variables: `Highest Education` <chr>,
## # `Location (City Airport Code)` <chr>, `Phone OS` <chr>, State <chr>,
## # Zone <chr>,
## # `How many followers do you have on Instagram? (In case of multiple accounts, please mention the one with the maximum)` <dbl>,
## # `How many posts do you have on Instagram?` <dbl>, Latitude <dbl>, …
#Only people who have more than 100 posts on Instagram
more_than_100_posts <- subset(data, `How many posts do you have on Instagram?` > 100)
more_than_100_posts
## # A tibble: 444 × 26
## Age City `Current Status` Do you own multiple profil…¹ Gender
## <dbl> <chr> <chr> <chr> <chr>
## 1 25 Vishakhapatnam Working professional Yes Female
## 2 25 Bengaluru Student No Male
## 3 25 Ahmedabad Self Employed Yes Male
## 4 50 Kolkata Working professional No Female
## 5 21 Chennai Student No Female
## 6 25 Kolkata Working professional No Male
## 7 45 Bagdogra Working professional Yes Female
## 8 38 Bengaluru Working professional No Female
## 9 24 Kolkata Student Yes Male
## 10 21 Chennai Student Yes Female
## # ℹ 434 more rows
## # ℹ abbreviated name: ¹`Do you own multiple profiles on Instagram?`
## # ℹ 21 more variables: `Highest Education` <chr>,
## # `Location (City Airport Code)` <chr>, `Phone OS` <chr>, State <chr>,
## # Zone <chr>,
## # `How many followers do you have on Instagram? (In case of multiple accounts, please mention the one with the maximum)` <dbl>,
## # `How many posts do you have on Instagram?` <dbl>, Latitude <dbl>, …
Question How well does the linear regression model predict the “Total Social Media Usage” column based on the Age, How many followers do you have on Instagram?, and Time Spent on Facebook in last week (in minutes) columns?
require(ggplot2)
## Loading required package: ggplot2
# Create a linear regression model
model <- lm(`Total Social Media Usage` ~ Age + `How many followers do you have on Instagram? (In case of multiple accounts, please mention the one with the maximum)` + `Time Spent on Facebook in last week (in minutes)`, data = data)
# Create a data frame with the actual and predicted values
predictions <- data.frame(Actual = data$`Total Social Media Usage`, Predicted = predict(model))
# Create a scatter plot of the actual vs predicted values
ggplot(predictions, aes(x = Actual, y = Predicted)) +
geom_point() +
geom_abline(intercept = coef(model)[1], slope = coef(model)[2], color = "red") +
labs(title = "Actual vs Predicted Total Social Media Usage", x = "Actual", y = "Predicted")
result = .the linear regression model to predict the total social media
usage based on the age, number of followers on Instagram, and time spent
on Facebook in the last week. .predictions that contains the actual and
predicted values of the total social media usage. Actual column contains
the actual values from the Total Social Media Usage .Predicted column
contains the predicted values based on the linear regression model.
Question What is the relationship between the number of followers and the number of posts on Instagram for users with more than 1000 followers and those with more than 100 posts but less than or equal to 1000 followers?
plot(data[data$`How many followers do you have on Instagram? (In case of multiple accounts, please mention the one with the maximum)` > 1000, ]$`How many followers do you have on Instagram? (In case of multiple accounts, please mention the one with the maximum)`, data[data$`How many followers do you have on Instagram? (In case of multiple accounts, please mention the one with the maximum)` > 1000, ]$`How many posts do you have on Instagram?`, col = "blue", xlab = "Number of followers", ylab = "Number of posts")
points(data[data$`How many followers do you have on Instagram? (In case of multiple accounts, please mention the one with the maximum)` <= 1000 & data$`How many posts do you have on Instagram?` > 100, ]$`How many followers do you have on Instagram? (In case of multiple accounts, please mention the one with the maximum)`, data[data$`How many followers do you have on Instagram? (In case of multiple accounts, please mention the one with the maximum)` <= 1000 & data$`How many posts do you have on Instagram?` > 100, ]$`How many posts do you have on Instagram?`, col = "red")
legend("topright", legend = c("More than 1000 followers", "More than 100 posts"), col = c("blue", "red"), pch = 1)
creates a scatter plot of the number of followers on Instagram vs the number of posts on Instagram for the respondents who have more than 1000 followers or more than 100 posts.
Question plot the chart of males and females
require(ggplot2)
# Create a polar chart for gender distribution
ggplot(data, aes(x = "", fill = Gender)) +
geom_bar(width = 1) +
coord_polar(theta = "y") +
labs(title = "Gender Distribution", fill = "Gender")
Question What is the age distribution of the individuals in the data by all ages
ggplot(data, aes(x = Age, fill = factor(Age))) +
geom_histogram(binwidth = 5, color = "black") +
scale_fill_viridis_d() +
labs(title = "Age Distribution", x = "Age", y = "Count") +
theme_minimal()
Question What is the age group with the highest total number of followers on Instagram?
require(tidyverse)
## Loading required package: tidyverse
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.1.2 ✔ stringr 1.5.0
## ✔ forcats 1.0.0 ✔ tibble 3.2.1
## ✔ lubridate 1.9.2 ✔ tidyr 1.3.0
## ✔ purrr 1.0.1
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
# pie chart for the number of followers by age group
followers_by_age <- data %>%
group_by(Age) %>%
summarise(total_followers = sum(`How many followers do you have on Instagram? (In case of multiple accounts, please mention the one with the maximum)`))
ggplot(followers_by_age, aes(x = "", y = total_followers, fill = Age)) +
geom_bar(width = 1, stat = "identity") +
coord_polar(theta = "y") +
labs(title = "Number of Followers on Instagram by Age Group", fill = "Age") +
theme_void() +
scale_fill_gradient(low = "#FFC0CB", high = "#ADD8E6")
Question What is the distribution of education level among males and females?
# bar chart with education level
ggplot(data, aes(x = `Highest Education`, fill = Gender)) +
geom_bar(color = "black", size = 0.5, width = 0.7, position = position_dodge()) +
labs(title = "Education Level Distribution", x = "Education Level", y = "Count") +
theme_minimal() +
theme(legend.position = "top", legend.title = element_blank()) +
scale_fill_manual(values = c("#FFC0CB", "#ADD8E6", "#90EE90")) +
guides(fill = guide_legend(reverse = TRUE)) +
geom_text(aes(label=after_stat(count)), stat='count', position=position_dodge(width=0.7), vjust=-0.5, size=3)
## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
## ℹ Please use `linewidth` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
the bar chart shows the distribution of education levels by gender, with
each bar representing an education level and the color of the bar
representing the gender. The side-by-side positioning of the bars makes
it easy to compare the distribution of education levels between males
and females. The legend at the top of the plot indicates the
color-coding of the bars, while the labels on top of the bars indicate
the count of respondents in each education level and gender group. in
graduation female =462 and male =487 non binary=1 in High School female
=76 and male =61 non binary=0 in Post Graduation female =275 and male
=265 non binary=1
Question Create a bar chart with phone operating system
ggplot(data, aes(x = `Phone OS`, fill = Gender)) +
geom_bar() +
labs(title = "Phone Operating System Distribution", x = "Phone Operating System", y = "Count")
plot shows the distribution of phone operating systems by gender, with
each bar representing a phone operating system and the color of the bar
representing the gender
Question Create a pie chart for phone operating system distribution
ggplot(data, aes(x = "", fill = `Phone OS`)) +
geom_bar(width = 1) +
coord_polar(theta = "y") +
labs(title = "Phone Operating System Distribution", fill = "Phone Operating System")
plot shows the distribution of phone operating systems in a circular
format, with each slice representing a phone operating system and the
size of the slicerepresenting the count of respondents who use that
operating system.
Question Create a scatter plot for time spent on Facebook and Instagram
ggplot(data, aes(x = `Time Spent on Facebook in last week (in minutes)`, y = `Time Spent on Instagram in last week (in minutes)`)) +
geom_point(color = "#FFC0CB") +
labs(title = "Time Spent on Facebook vs. Time Spent on Instagram", x = "Time Spent on Facebook (in minutes)", y = "Time Spent on Instagram (in minutes)")
plot shows the relationship between the time spent on Facebook and the
time spent on Instagram in the last week
Question histogram for social media usage distribution
ggplot(data, aes(x = `Total Social Media Usage`)) +
geom_histogram(binwidth = 500, fill = "#FFC0CB", color = "black") +
labs(title = "Social Media Usage Distribution", x = "Total Social Media Usage (in minutes)", y = "Count") +
theme_minimal() +
theme(plot.background = element_rect(fill = "#ADD8E6"),
axis.text = element_text(size = 12, color = "black"),
axis.title = element_text(size = 14, color = "black"),
plot.title = element_text(size = 16, color = "black"))
plot shows the distribution of total social media usage in the data,
with the x-axis representing the total social media usage in minutes and
the y-axis representing the count of respondents in each usage group.
The color of the bars is a light pink color, while the outline of the
bars is black.
Question Create a scatter plot for location and social media usage
ggplot(data, aes(x = Longitude, y = Latitude, color = `Total Social Media Usage`)) +
borders("world", colour="gray50", fill="lightgreen") +
geom_point(size = 3) +
scale_color_gradient(low = "#ADD8E6", high = "#FFC0CB") +
labs(title = "Location vs. Social Media Usage", x = "Longitude", y = "Latitude", color = "Total Social Media Usage (in minutes)")
plot shows the relationship between the location of total social media
usage, with each point representing a respondent in the data. The color
of the points indicates the total social media usage in minutes, with a
blue color indicating lower usage and a pink color indicating higher
usage. The world map in the background provides context for the location
of the respondents.
Question Create a histogram for time spent on WhatsApp distribution
ggplot(data, aes(x = `Time Spent on WhatsApp in last week (in minutes)`, fill = Gender)) +
geom_histogram(binwidth = 100) +
labs(title = "Time Spent on WhatsApp Distribution", x = "Time Spent on WhatsApp (in minutes)", y = "Count")
plot shows the distribution of time spent on WhatsApp in the last week
by gender, with the x-axis representing the time spent on WhatsApp in
minutes and the y-axis representing the count of respondents in each
usage group. The bars are color-coded by gender, with a blue color
indicating non binary and a red color indicating female respond ,green
color indicating the male .
Question Create a bar chart for education level and social media usage
ggplot(data, aes(x = `Highest Education`, y = `Total Social Media Usage`, fill = `Highest Education`)) +
geom_bar(stat = "summary", fun = "mean") +
labs(title = "Education Level vs. Social Media Usage", x = "Education Level", y = "Total Social Media Usage (in minutes)") +
scale_fill_manual(values = c("#FFC0CB", "#ADD8E6", "#90EE90", "#FFD700")) +
theme_minimal()
plot shows the relationship between the highest education level and the total social media usage in the data, with each bar representing a respondent in the data. The height of the bars represents the mean total social media usage for each education level while the color of the bars indicates the education level
Question Distribution of the number of posts on Instagram
ggplot(data, aes(x = `How many posts do you have on Instagram?`)) +
geom_histogram(binwidth = 50, fill = "#ADD8E6") +
labs(title = "Number of Posts on Instagram Distribution", x = "Number of Posts on Instagram", y = "Count") +
theme_minimal()
plot shows the distribution of the number of posts on Instagram in the
data, with the x-axis representing the number of posts and the y-axis
representing the count of respondents in each post group. The bars are
colored in a light blue color.
Question Relationship between age and the number of posts on Instagram
ggplot(data, aes(x = Age, y = `How many posts do you have on Instagram?`)) +
geom_point() +
labs(title = "Age vs Number of Posts on Instagram", x = "Age", y = "Number of Posts on Instagram")
plot shows the relationship between the age of the respondents and the number of posts on Instagram, with each point representing a respondent in the data. The x-axis represents the age of the respondents, while the y-axis represents the number of posts on Instagram.
Question Distribution of the time spent on Facebook
ggplot(data, aes(x = `Time Spent on Facebook in last week (in minutes)`)) +
geom_histogram(binwidth = 100, fill = "pink") +
labs(title = "Time Spent on Facebook Distribution", x = "Time Spent on Facebook (in minutes)", y = "Count") +
theme_minimal()
plot shows the distribution of time spent on Facebook in the last week
in the data, with the x-axis representing the time spent on Facebook in
minutes and the y-axis representing the count of respondents in each
usage . The bars are colored in a pink
Question Relationship between age and the time spent on Facebook
ggplot(data, aes(x = Age, y = `Time Spent on Facebook in last week (in minutes)`)) +
geom_point() +
labs(title = "Age vs Time Spent on Facebook", x = "Age", y = "Time Spent on Facebook (in minutes)")
plot shows the relationship between the age of the respondents and the
time spent on Facebook in the last week, with each point representing a
respondent in the data. The x-axis represents the age of the
respondents, while the y-axis represents the time spent on Facebook in
minutes
Question Relationship between age and the time spent on Instagram
ggplot(data, aes(x = Age, y = `Time Spent on Instagram in last week (in minutes)`)) +
geom_point() +
labs(title = "Age vs Time Spent on Instagram", x = "Age", y = "Time Spent on Instagram (in minutes)")
plot shows the relationship between the age of the respondents and the time spent on Instagram in the last week, with each point representing a respondent in the data. The x-axis represents the age of the respondents, while the y-axis represents the time spent on Instagram in minutes.
Question Distribution of the total social media usage
ggplot(data, aes(x = `Total Social Media Usage`, fill = Gender)) +
geom_histogram(binwidth = 500) +
labs(title = "Total Social Media Usage Distribution", x = "Total Social Media Usage", y = "Count") +
scale_fill_manual(values = c("#ADD8E6", "#FFC0CB", "#FF0000")) + # Add a third color value
theme_minimal() +
theme(legend.position = "bottom")
plot shows the distribution of total social media usage in the data by
gender, with the x-axis representing the total social media usage in
minutes and the y-axis representing the count of respondents in each
usage group. The bars are color-coded by gender, with a blue color
indicating female , a pink color indicating male, and a red color
indicating non-binary respondents.
Question Relationship between age and the total social media usage
ggplot(data, aes(x = Age, y = `Total Social Media Usage`)) +
geom_point() +
labs(title = "Age vs Total Social Media Usage", x = "Age", y = "Total Social Media Usage")
plot shows the relationship between the age of the respondents and the
total social media usage in the data, with each point representing a
respondent in the data. The x-axis represents the age of the
respondents, while the y-axis represents the total social media usage in
minutes.
Question Relationship between the number of followers on Instagram and the number of posts on Instagram
ggplot(data, aes(x = `How many followers do you have on Instagram? (In case of multiple accounts, please mention the one with the maximum)`, y = `How many posts do you have on Instagram?`)) +
geom_point() +
labs(title = "Number of Followers vs Number of Posts on Instagram", x = "Number of Followers on Instagram", y = "Number of Posts on Instagram")
plot shows the relationship between the number of followers on Instagram
and the number of posts on Instagram, with each point representing a
respondent in the data. The x-axis represents the number of followers on
Instagram, while the y-axis represents the number of posts on
Instagram.
Question Pie chart for current status distribution
ggplot(data, aes(x = "", fill = `Current Status`)) +
geom_bar(width = 1) +
coord_polar(theta = "y") +
labs(title = "Current Status Distribution", fill = "Current Status")
plot shows the distribution of the current status variable in the data, with each bar representing a respondent in the data. The bars are color-coded by the current status variable, with each color representing a different status. The polar coordinate system is used to display the bars in a circular pattern, with the length of each bar representing the count of respondents in each status
#thank you mam
ggplot() +
geom_text(aes(x = 0.5, y = 0.5, label = "Thank You Mam", size = 10)) +
theme_void()