X1 X2 n
16 18 10
18 20 30
20 22 40
22 24 20
to import data I use the following code
Code : Tout sélectionner
dat <- data.frame( X1 = c(16, 18, 20, 22), X2 = c(18, 20, 22,24), n = c(10, 30, 40,20))
and to caculate frequence I apply this code
Code : Tout sélectionner
data.frame(X1,X2,ci=(X1+X2)/2,Eff=n,EffCum=cumsum(n),Freq=n/sum(n),FreqCum=cumsum(n/sum(n)))
can you please help me how I can determine characteristics of this distribution (mode, mean, median, variance...) knowing that when I used this code
Code : Tout sélectionner
summary(dat)
it appears that R did not take into consideration that X1 and X2 are the two bounds of an interval and it considers them as discrete data. the output founded is like this:
X1 X2 n
Min. :16.0 Min. :18.0 Min. :10.0
1st Qu.:17.5 1st Qu.:19.5 1st Qu.:17.5
Median :19.0 Median :21.0 Median :25.0
Mean :19.0 Mean :21.0 Mean :25.0
3rd Qu.:20.5 3rd Qu.:22.5 3rd Qu.:32.5
Max. :22.0 Max. :24.0 Max. :40.0
can you help me please?