0% found this document useful (0 votes)
2 views12 pages

R Statistical Analysis Techniques

Uploaded by

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

R Statistical Analysis Techniques

Uploaded by

aryan rane
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

Statistical Analysis by R

By
Sunil Kadam
d1=c(6,7,5,7,7,8,7,6,9,7,4,10,6,8,8,9,5,6,4,8)
table(d1)
sort(d1)
table(d1)
cumsum(table(d1))
hist(d1)

mean(d1)

median(d1)

mode=names(table(d1))[table(d1)==max(table(d1))]
# Mean Deviation for d1

d1
length(d1)
m1=mean(d1)
m1
d1_mean_diff=c(abs(d1-m1))
d1_mean_diff
sum_md=sum(d1_mean_diff)
md=sum_md/length(d1)
md
# Calculation of Mean Deviation from Median
d1
m2=median(d1)
m2
m_diff_med=c(abs(d1-m2))
sum_m_diff_med=sum(m_diff_med)
md_median=sum_m_diff_med/length(d1)
md_median
calls=c(28,122,217,130,120,86,80,90,140,120,70,40,145,113,90,68,174,194,170,100,75,104,9
7,75,123,100,75,104,97,75,123,100,89,120,109)
range(calls)
low_val=0
high_val=240
step_val=40
x_breaks=seq(low_val,high_val,by=step_val)
cut(calls,break=x_breaks,right=FALSE)
I=cut(calls,break=x_breaks,right=FALSE)
y=table(I)
df=[Link](y)
df$cumf=cumsum(df$freq)
summary(df)
hist(calls)
I_mid=seq(low_val+step_val/2,high_val-step_val/2,step_val)
df$I_mid=I_mid
df
med1=80+step_val*(35/2-8)/14
mod1=80+step_val*(14-7)/(2*14-7-9)
sd(d1)
var(d1)
25
56
87
65
34
99
35
87
77
94
wt1=c(25,56,87,65,34,99,35,87,77,87)
table(wt1)
cumsum(table(wt1))
hist(wt1)
range(wt1)
l1=20
maxl2=100
step1=20
x_br1=seq(l1,maxl2,by=step1)
int1=cut(wt1,x_br1,right = FALSE)
Y1=table(int1)
df_wt$cumfq=cumsum(df_wt$Freq)
df_wt
mean(wt1)
median(wt1)
m1=names(table(wt1))[table(wt1)==max(table(wt1))]
m1
# Reading data from CSV files
d2=[Link]("[Link]")
d2
nrow(d2)
ncol(d2)
# Structure of CSV dataframe
str(t1)
# Calculations on CSV files records
max(d2$Age)
# Extracting records from data
a1=subset(d2,Age==max(d2$Age))
a1
a1=subset(d2,name=="sunil")
a1
a1=subset(d2,Age>=25)
a1
mean_age=mean(d2$Age)
mean_age
d2$Dept
subset(d2,Dept=="IT")
# Adding Records to existing data with rbind()
newd2=[Link](Roll_no=c(106,107),name=c("sana","bina"),Age=c(25,24),Dept=c("IT","HR"))
combine_d2=rbind(d2,newd2)
combine_d2
# installing libary MASS
library("MASS")
# one of file in MASS

ships
# Structure of file ships

str(ships)
# Analysis of ships
max(ships$incidents)
max(ships$service)
summary(ships$service)
# extracting field from ship to new variable
tys=c(ships$type)
tys
table(tys)
cumsum(table(tys))
table(yrs)
summary(yrs)
hist(yrs)

You might also like