Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## SL Lab1 (zestaw 4)
- library(ggplot2)
- # PART 1 ------------------------------------------------------------------
- dataset1<-part1_set04
- #1
- #The data is normal if the p-value is above 0.05. So we now know our variable is normally distributed.
- shapiro.test(dataset1$dose)
- shapiro.test(dataset1$concentration)
- #2
- ggplot(dataset1, aes(x=dose, y=concentration)) + geom_point()
- #3
- #install.packages("ggpubr")
- library("ggpubr")
- r = cor(dataset1$dose, dataset1$concentration, method = "pearson")
- #5
- #b1 = (1/(n-1))*( (sum((xi-xŚr)(yi-yŚr))) / (sd(dataset1$dose)*sd(dataset1$concentration)) ) * ()
- # b1 = r*(sd(dataset1$dose)/sd(dataset1$concentration))
- # b0 = mean(dataset1$dose) - b1*mean(dataset1$concentration)
- b1 = r*(sd(dataset1$concentration)/sd(dataset1$dose))
- b0 = mean(dataset1$concentration) - b1*mean(dataset1$dose)
- lm(dataset1)
- ggplot(dataset1, aes(x=dose, y=concentration)) +
- geom_point(shape=1) +
- geom_smooth(method=lm, se=FALSE)
- # PART 2 ------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement