Skip to content

Instantly share code, notes, and snippets.

View Harshit1694's full-sized avatar

HARSHIT GUPTA Harshit1694

View GitHub Profile
#Step 4 - Conduct two-sample t-test
#Null Hypothesis: There is no difference between the mean of two samples
#Alternate Hypothesis: There is difference between the men of two samples
t.test(data$screensize_sample1,data$screensize_sample2,var.equal = T)
#Step 4 - Conduct two-sample t-test
#Null Hypothesis: There is no difference between the means of tyres before and after changing the rubber material.
#Alternate Hypothesis: There is a difference between the means of tyres before and after changing the rubber material.
t.test(data$tyre_1,data$tyre_2,paired = T)
#Step 3 - Check for assumptions
#______________________________________________________
#1. Observations in the data are independent from one another.
#2. Samples are independent from each other.
#3. To check the data is normally distributed, we will use the following codes:
shapiro.test(data$Stock.A)
shapiro.test(data$Stock.B)
#Step 4 - Conduct F-test for equality of variances
#Null Hypothesis: Variances of both the stocks are equal i.e σ1^2 = σ2^2 or
#Variance of the stock A is less than the variance of Stock B or σ1^2 < σ2^2
#Alternate Hypothesis: Variance of the stock B is less than the variance of Stock A or σ1^2 > σ2^2
var.test(data$Stock.A,data$Stock.B)
#Step 3 - Calculate the proportion of experience of employees
#Proportion table for observed frequencies
prop.table((table(data$Experience.intervals)))
#Step 4 - Calculate the chi-square value
#_______________________________________________________
chisq.test(x = table(data$Experience.intervals),
p = c(0.2, 0.17, 0.41, 0.22))
#Step 3 - Make a table and Calculate the chi-square value
#_______________________________________________________
ct<-table(data$age.intervals,data$Experience.intervals)
ct
chisq.test(ct)
install.packages("shiny")
install.packages("shinydashboard")
library(shiny)
library(shinydashboard)
ui<-shinyUI(
dashboardPage(
dashboardHeader(title = "BLACK FRIDAY SALES",titleWidth = 300,
dropdownMenu(type = "messages",
messageItem(
from = "Harshit Gupta",
data<-read.csv(file.choose())
u1 <- data$User_ID
df_uniq1 <- unique(u1)
l1<-length(df_uniq1)
u2 <- data$Product_ID
df_uniq2 <- unique(u2)
l2<-length(df_uniq2)
frow_c <- fluidRow(
box(
title = "Purchase amount by Males and Females"
,status = "primary"
,solidHeader = TRUE,background = 'purple'
,collapsible = TRUE
,plotOutput("pie_1")
),
box(
title = "Purchase amount by Age intervals"