## Step 1 ; Load the data set
abtest<-read.csv("C:\\Users\\admin\\Desktop\\Statistical computing 1\\Data\\abtest.csv")

Univariate analysis

mean(abtest$time_spent_on_the_page,na.rm=TRUE)
## [1] 5.3778
median(abtest$time_spent_on_the_page)
## [1] 5.415
sd(abtest$time_spent_on_the_page)
## [1] 2.378166
range(abtest$time_spent_on_the_page)
## [1]  0.19 10.71
IQR(abtest$time_spent_on_the_page)
## [1] 3.1425
max(abtest$time_spent_on_the_page)
## [1] 10.71
min(abtest$time_spent_on_the_page)
## [1] 0.19

Converted

table(abtest$time_spent_on_the_page)
## 
##  0.19  0.22   0.4  0.91  0.93  1.44  1.65  1.81  1.92  2.08  2.23  2.58  2.66 
##     1     1     2     1     1     1     1     1     1     1     1     1     1 
##   2.9  3.02  3.05  3.13  3.21   3.3  3.48  3.52  3.65  3.68  3.88  3.91  4.05 
##     1     1     1     1     1     1     1     1     1     1     2     1     1 
##  4.18  4.28   4.3  4.39   4.4  4.46  4.52  4.68  4.71  4.75  4.87  4.94  5.08 
##     1     1     1     1     1     1     1     1     1     2     1     1     1 
##  5.15  5.25  5.26  5.28  5.37  5.39   5.4  5.41  5.42  5.47  5.65  5.74  5.86 
##     1     1     1     1     1     1     1     1     1     1     1     1     2 
##  5.96  6.01  6.03  6.04  6.18   6.2  6.21  6.27  6.41  6.47  6.52  6.53  6.57 
##     1     1     1     2     1     1     1     1     1     1     1     1     1 
##   6.6   6.7  6.71  6.79  7.02  7.03  7.07  7.13  7.16  7.23  7.27   7.4  7.46 
##     1     1     1     1     1     1     1     1     2     1     1     1     1 
##  7.81  8.02  8.08   8.3  8.35  8.46  8.47   8.5  8.72  8.73  9.12  9.15  9.49 
##     1     1     1     1     1     1     1     1     1     1     1     1     1 
##  10.3  10.5 10.71 
##     1     1     1
prop.table(abtest$time_spent_on_the_page)
##   [1] 0.0064710476 0.0132582097 0.0081817844 0.0056156793 0.0088326081
##   [6] 0.0098181412 0.0097623564 0.0121425118 0.0199152070 0.0038677526
##  [11] 0.0115474729 0.0047975008 0.0108966492 0.0112127636 0.0162148090
##  [16] 0.0116590427 0.0162334040 0.0007437986 0.0191528134 0.0072148462
##  [21] 0.0049462606 0.0130722600 0.0067871620 0.0130536651 0.0114916881
##  [26] 0.0081631894 0.0176466213 0.0075309606 0.0145226673 0.0079586448
##  [31] 0.0100598758 0.0065454275 0.0100226859 0.0084049239 0.0082933542
##  [36] 0.0158057198 0.0058202239 0.0112313585 0.0030681691 0.0003533043
##  [41] 0.0157313400 0.0035702332 0.0133139946 0.0133139946 0.0072706311
##  [46] 0.0149131615 0.0099854959 0.0134441593 0.0150247313 0.0195247127
##  [51] 0.0004090892 0.0105061549 0.0120309420 0.0087582283 0.0119193722
##  [56] 0.0017293317 0.0033656886 0.0154338205 0.0137602737 0.0170143925
##  [61] 0.0111755737 0.0126259809 0.0077726952 0.0101714456 0.0110825988
##  [66] 0.0135185392 0.0122726766 0.0088326081 0.0124586262 0.0041466771
##  [71] 0.0007437986 0.0100784708 0.0094462420 0.0138718435 0.0090557477
##  [76] 0.0122168917 0.0026776749 0.0072148462 0.0169586076 0.0059689836
##  [81] 0.0087024434 0.0097809513 0.0106735096 0.0053925397 0.0079958347
##  [86] 0.0016921418 0.0124772212 0.0068429469 0.0061363383 0.0112313585
##  [91] 0.0100412808 0.0157499349 0.0155267953 0.0091859125 0.0056714642
##  [96] 0.0095764067 0.0121239168 0.0131466399 0.0115288780 0.0108966492

##load the required package ``{r} library(ggplot2) library(dplyr) library(readr) library(stats) library(tidyverse)

## ploting

``` r
library(ggplot2)
## Warning: package 'ggplot2' was built under R version 4.5.2
## Plotting

# Histogram
ggplot(abtest, aes(x = time_spent_on_the_page)) +
  geom_histogram()
## `stat_bin()` using `bins = 30`. Pick better value `binwidth`.

# Boxplot comparing time spent by landing page
ggplot(abtest, aes(x = landing_page, y = time_spent_on_the_page)) +
  geom_boxplot()

# Density plot
ggplot(abtest, aes(x = time_spent_on_the_page)) +
  geom_density()

# Bar plot (counts of landing_page instead of continuous time)
ggplot(abtest, aes(x = landing_page)) +
  geom_bar()