82 lines
2.8 KiB
R
82 lines
2.8 KiB
R
|
pomiar_1<-c(5.4,21.2,6.4,12.5,26.4,33.3,26.4,26.6,21.0,16.8,15.6,40.0,46.6,19.8,28.4,20.0,37.2)
|
||
|
pomiar_2<-c(16.8,34.0,5.3,33.0,26.4,22.5,13.5,11.0,12.5,8.0,14.6,42.4,55.5,25.8,23.0,25.5,24.5)
|
||
|
pomiar_3<-c(6.8,30.0,21.7,10.8,23.0,27.7,8.8,16.4,12.5,7.5,11.4,31.4,34.5,23.0,25.4,20.1,28.8)
|
||
|
pomiar_4<-c(22.5,18.0,4.3,16.8,20.0,40.0,15.5,27.0,10.2,6.5,14.4,36.6,25.5,18.4,10.0,17.2,15.5)
|
||
|
par(mfrow=c(2,2))
|
||
|
hist(pomiar_1)
|
||
|
hist(pomiar_2)
|
||
|
hist(pomiar_3)
|
||
|
hist(pomiar_4)
|
||
|
pomiary<-c(pomiar_1,pomiar_2,pomiar_3,pomiar_4)
|
||
|
pomiary<-c(pomiar_1,pomiar_2,pomiar_3,pomiar_4)
|
||
|
pomiary<-c(pomiar_1,pomiar_2,pomiar_3,pomiar_4)
|
||
|
dane<-matrix(pomiary,nrow = 17)
|
||
|
d1 <- data.frame(pomiar_1,pomiar_1, pomiar_2, pomiar_2)
|
||
|
View(dane)
|
||
|
View(dane)
|
||
|
View(d1)
|
||
|
View(d1)
|
||
|
plot(d1, main = "Wykres rozrzutu", pch = 16)
|
||
|
pairs(data.frame(pomiar_1,pomiar_2,pomiar_3,pomiar_4))
|
||
|
shapiro.test(pomiar_1)
|
||
|
shapiro.test(pomiar_2)
|
||
|
shapiro.test(pomiar_3)
|
||
|
shapiro.test(pomiar_4)
|
||
|
qqnorm(pomiar_1)
|
||
|
qqline(pomiar_1)
|
||
|
g <- factor(rep(1:4, c(17, 17, 17, 17)))
|
||
|
require(graphics)
|
||
|
boxplot(as.vector(dane) ~ g)
|
||
|
hist(pomiar_1)
|
||
|
bartlett.test(as.vector(dane) ~ g, data = dane)$p.value
|
||
|
fligner.test(as.vector(dane) ~ g, data = dane)$p.value
|
||
|
summary(aov(as.vector(dane) ~ g, data = data.frame(pomiar_1,pomiar_2,pomiar_3,pomiar_4)))
|
||
|
pairwise.t.test(as.vector(dane),g,data = data.frame(pomiar_1,pomiar_2,pomiar_3,pomiar_4))
|
||
|
plec <-ifelse(Dyslexia$gender=="female",0,1)
|
||
|
reka <-ifelse(Dyslexia$handed=="right",1,0)
|
||
|
require(Dyslexia)
|
||
|
require(BSDA)
|
||
|
install.packages("BSDA")
|
||
|
require(BSDA)
|
||
|
plec <-ifelse(Dyslexia$gender=="female",0,1)
|
||
|
reka <-ifelse(Dyslexia$handed=="right",1,0)
|
||
|
dane<-subset(Dyslexia,select=c(age,weight,height,words))
|
||
|
pairs(dane)
|
||
|
model1<-lm(words~age+weight+height,data=dane)
|
||
|
summary(model1) #nieistotne zmienne
|
||
|
step(model1)
|
||
|
model2<-lm(words~weight+height,data=dane)
|
||
|
summary(model2)
|
||
|
step(model2)
|
||
|
model3 <- lm(weight ~ height, data = dane)
|
||
|
summary(model3)
|
||
|
temp_height <- data.frame(height = seq(min(dane$height) - 10,
|
||
|
max(dane$height) + 10,
|
||
|
length = 100))
|
||
|
pred <- stats::predict(model3, temp_height, interval = "prediction")
|
||
|
plot(dane$height,dane$weight, main = "Wykres rozrzutu", pch = 16)
|
||
|
abline(model3, col = "red", lwd = 2)
|
||
|
nowa_wys<-data.frame(height=67)
|
||
|
predict(model3,nowa_wys,interval="prediction")
|
||
|
pred_67<-predict(model3,nowa_wys,interval="prediction")
|
||
|
pred_67<-predict(model3,nowa_wys,interval="prediction")
|
||
|
points(67, pred_67[, 1], col = "blue", pch = 16)
|
||
|
x1<-rexp(30,5)
|
||
|
x2<-rnorm(30,2,2)
|
||
|
x3<-rnorm(30,10,1)
|
||
|
gen<-c(x1,x2,x3)
|
||
|
par(mfrow=c(2,2))
|
||
|
plot(density(x,bw=0.1))
|
||
|
plot(density(gen,bw=0.1))
|
||
|
plot(gen)
|
||
|
plot(density(gen,bw=0.1))
|
||
|
plot(density(x,bw=0.5))
|
||
|
plot(density(gen,bw=0.5))
|
||
|
par(mfrow=c(2,2))
|
||
|
plot(density(gen,bw=0.1))
|
||
|
plot(density(gen,bw=0.5))
|
||
|
plot(density(x,bw=3))
|
||
|
plot(density(x,bw=5)) #na trzecim
|
||
|
plot(density(gen,bw=3))
|
||
|
plot(density(gen,bw=5)) #na trzecim
|