D
@drfperez
Exoplanets
x<- c(0.3, 2, 1, 1.5, 1.8, 0.8)
y <- c(0.9, 5.6, 3.7, 5, 4.5, 1.2)
relation <- lm(log(y)~0+log(x))
print(summary(relation))
myexoplanet<- data.frame(x = 1.4)
result <- predict(relation,myexoplanet)
print(result)
plot(log(x),y,col = "blue",main = "Mass and radius of exoplanets", abline(lm(log(y)~0+log(x))),cex = 1.3,pch = 16,xlab = "Mass in Earth masses",ylab = "Earth radius")
ion", abline(lm(y~log(x))),cex = 1.3,pch = 16,xlab = "Log (Mass) in Earth masses",ylab = "Earth radius Regression",
Cepheids
x<- c(3, 5, 10, 30, 50, 101)
y <- c(-3.5, -4.6, -5.7, -6, -6.5, -7.2)
relation <- lm(y~log(x))
print(summary(relation))
mycepheid<- data.frame(x = 19)
result <- predict(relation,mycepheid)
print(result)
plot(log(x),y,col = "blue",main = "Period &Absolute magnitude Cepheid Regression", abline(lm(y~log(x))),cex = 1.3,pch = 16,xlab = "Log (Period) in days",ylab = "Absolute magnitude")