Professional Documents
Culture Documents
Code. Demanda de Video Games en Japan. Manuel Castillo
Code. Demanda de Video Games en Japan. Manuel Castillo
Manuel Castillo.
library(PerformanceAnalytics)
library(quantmod) # Datos.
library(tidyverse) # graph
library(forecast)
View(Bike)
select(c(Time,Rented
,Morning,Afternoon,Temperature,Humidity,WindSpeed,Rainfall,Snowfall,Holiday))
head(bike)
# Scatterplot with regression line,Rented=f(Temperature)
geom_point() +
geom_point() +
geom_point() +
geom_point() +
geom_point() +
# Linear model
summary(mod_bike)
hist(errorRented)
plot.ts(errorRented)
# Ahora voy a darles otro formtatp alarchivo para poder seguir adelante.
bike_data
head(bike_data)
attach(bike_data)
Rented
Morning
RentAndRente=cbind(Rented,ERented)
ts.plot(RentAndRente)
anova(mod_bike)
# PRUEBA F CALCuLADA
FRented
PredictRented<-forecast(mod_bike,FRented)
PredictRented
library(haven)
library(stargazer)
residuos<-mod_bike$residuals
hist(residuos)
plot.ts(residuos)
library(lmtest)
library(nortest)
# En la prueba de normalidad siguiente la HO:Los errores son normales Vs Ha: No son normales
# data: residuos
# data: residuos
# D = 0.067141, p-value < 2.2e-16 Por lo tanto se rechaza la HO. Conclusion no son normales
los errores.
qqnorm(residuos)
qqline(residuos)
# En la prueba de HOMOCEDASTICITY
# data: mod_bike
# Goldfeld-Quandt test
# data: mod_bike
dwtest(mod_bike)
# data: mod_bike
################################################################################
###############################################################################
library(PerformanceAnalytics)
library(quantmod) # Datos.
library(tidyverse) # graph
library(broom) # Summary of Regression.
library(forecast)
View(VideoG)
head(VideoG)
geom_point() +
# Linear model
summary(mod_video)
hist(errorVg)
plot.ts(errorVg)
library(lmtest)
library(nortest)
# En la prueba de normalidad siguiente la HO:Los errores son normales Vs Ha: No son normales
# data: errorVg
# data: errorVg
# D = 0.19629, p-value < 2.2e-16 Por lo tanto se rechaza la HO. Conclusion no son normales los
errores.
qqnorm(residuos)
qqline(residuos)
# En la prueba de HOMOCEDASTICITY
# Despues de calcular el modelo lineal lm(), podemos llevar a cabo la Prueba de Breusch–Pagan,
# data: mod_video
# Goldfeld-Quandt test
# data: mod_video
dwtest(mod_video)
# data: mod_bike