Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Data Transformation
#R version 3.3.2 data(iris) str(iris) library(MASS) library(ggplot2) attach(iris) head(iris) ##############Linear Model######### ggplot(iris, aes(Sepal.Width, Petal.Width, colour=Species))+geom_point()+geom_smooth(method=lm)+ggtitle("Sample") Mod=lm(Sepal.Width~Petal.Width) par(mfrow=c(2,2)) plot(Mod, main="Mod") #Log.transformation Mod1=lm(log(Sepal.Width)~log(Petal.Width)) plot(Mod1, main="Mod1") C=coef(Mod1) A=C[1] B=C[2] BackTransform=exp(A+B*log(Petal.Width)) head(BackTransform) #Sqrt.Transormation Mod2=lm(sqrt(Sepal.Width)~Petal.Width) plot(Mod2) C1=coef(Mod2) A1=C1[1] B1=C1[2] ######Box-cox######## bc=boxcox(Sepal.Width~Petal.Width, data=iris) Trans=bc$x[which.max(bc$y)] Mod3=lm(Sepal.Width^Trans~Petal.Width) summary(Mod3) plot(Mod3)
run
|
edit
|
history
|
help
0
Leap Year or Not
29-01-21TestesAjuste
Return the max, min, and zeros of a function y, and plot it.
03-08-2020-Derivada-Numerica
QRdecomposição
YD
TH1
Learning
confidence interval stuff
Julia set