0% found this document useful (0 votes)
39 views4 pages

Membuat Plot X Versus FX

The document discusses plotting distributions and calculating statistics for different probability distributions. It shows how to plot a discrete uniform distribution and combined distributions. It also calculates the mean and variance. Further sections demonstrate calculating probabilities and cumulative probabilities for binomial, Poisson and normal distributions. It concludes by calculating confidence intervals using the normal distribution with qnorm, qt and qchisq.

Uploaded by

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

Membuat Plot X Versus FX

The document discusses plotting distributions and calculating statistics for different probability distributions. It shows how to plot a discrete uniform distribution and combined distributions. It also calculates the mean and variance. Further sections demonstrate calculating probabilities and cumulative probabilities for binomial, Poisson and normal distributions. It concludes by calculating confidence intervals using the normal distribution with qnorm, qt and qchisq.

Uploaded by

Dion Abimanyu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Membuat plot x versus fx

x=c(0,1,2,3)

fx=c(1/8,3/8,3/8,1/8)

plot(x,fx) - cuman titik

plot(x,fx,type="h") - dengan garis

Membuat plot x versus Fx

Fx=c(1/8,4/8,7/8,1)

plot(x,Fx,type="h")

Menggabungkan kedua plot

par(mfrow=c(2,1))

plot(x,fx,type="h")

plot(x,Fx,type="h")

Menghitung nilai harapan E(X)

Ex=sum(x*fx)

Menghitung varians (2 = E(X2) [E(X)]2)

Ex.2=sum(x^2*fx) - cari E(X2) dulu

Ex.2

var.x=Ex.2-Ex^2 - masuk rumus

var.x
Densitas peluang sebaran normal

dbinom(0,10,prob=0.5)

dbinom(1,10,prob=0.5)

dbinom(2,10,prob=0.5)

dbinom(3,10,prob=0.5)

dbinom(4,10,prob=0.5)

dbinom(5,10,prob=0.5)

dbinom(6,10,prob=0.5)

dbinom(7,10,prob=0.5)

dbinom(8,10,prob=0.5)

dbinom(9,10,prob=0.5)

dbinom(10,10,prob=0.5)

kumulatif sebaran normal

pbinom(0,10,prob=0.5)

pbinom(1,10,prob=0.5)

pbinom(2,10,prob=0.5)

pbinom(3,10,prob=0.5)

pbinom(4,10,prob=0.5)

pbinom(5,10,prob=0.5)

pbinom(6,10,prob=0.5)

pbinom(7,10,prob=0.5)

pbinom(8,10,prob=0.5)

pbinom(9,10,prob=0.5)

pbinom(10,10,prob=0.5)
Contoh sebaran poisson

1-(dpois(0,0.096)+dpois(1,0.096))

dpois(1,0.096

Contoh sebaran normal

pnorm(0.14,0.124,0.02)

1-(pnorm(0.13,0.124,0.02))

Sebaran normal qnorm

n <- 9

xbar <- 400

sigma <- 30

batas <- qnorm(0.975)*sigma/sqrt(n)

batas.bawah <- xbar-batas

batas.atas <- xbar+batas

batas.bawah

batas.atas

selang <- c(batas.bawah,batas.atas)

selang
Sebaran normal qt

db <- n-1

batas.2 <- qt(0.975,df=db)*sigma/sqrt(n)

batas.bawah.2 <- xbar-batas.2

batas.atas.2 <- xbar+batas.2

batas.bawah.2

batas.atas.2

selang.2 <- c(batas.bawah.2,batas.atas.2)

selang.2

Sebaran normal qchisq

n <- 9

db <- n-1

s.2 <- 900

batas.bawah.3 <- (n-1)*s.2/qchisq(0.975,db)

batas.atas.3 <- (n-1)*s.2/qchisq(0.025,db)

batas.bawah.3

batas.atas.3

selang.3 <- c(batas.bawah.3,batas.atas.3)

selang.3

You might also like