setwd("C:/Users/L01191825/Documents/CADI Analitica_R")

inv_vs_inno<-read.csv("inversión vs innovación.csv")
Technology<-inv_vs_inno$p46
Innovation<-inv_vs_inno$p76
plot(Technology,Innovation)
abline(lm(Innovation~Technology)) 

regresion_linear<-lm(Innovation~Technology,)
summary(regresion_linear)
## 
## Call:
## lm(formula = Innovation ~ Technology)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.8787 -0.8787  0.1213  0.8345  5.1911 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  2.09563    0.21277   9.849  < 2e-16 ***
## Technology   0.35661    0.05012   7.115 6.16e-12 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.094 on 358 degrees of freedom
## Multiple R-squared:  0.1239, Adjusted R-squared:  0.1214 
## F-statistic: 50.62 on 1 and 358 DF,  p-value: 6.156e-12
Capital<-inv_vs_inno$p48
Innovation<-inv_vs_inno$p76
plot(Capital,Innovation)
abline(lm(Innovation~Capital)) 

regresion_linear2<-lm(Innovation~Capital,)
summary(regresion_linear2)
## 
## Call:
## lm(formula = Innovation ~ Capital)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.8137 -0.6026  0.1863  0.8195  4.8195 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   2.7584     0.2001  13.787  < 2e-16 ***
## Capital       0.2110     0.0507   4.163 3.94e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.141 on 358 degrees of freedom
## Multiple R-squared:  0.04617,    Adjusted R-squared:  0.04351 
## F-statistic: 17.33 on 1 and 358 DF,  p-value: 3.939e-05
Innovation<-inv_vs_inno$p76
New_methods_Tech<-inv_vs_inno$p47
plot(New_methods_Tech,Innovation)
abline(lm(Innovation~New_methods_Tech)) 

regresion_linear3<-lm(Innovation~New_methods_Tech,)
summary(regresion_linear3)
## 
## Call:
## lm(formula = Innovation ~ New_methods_Tech)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.8446 -0.8446  0.1554  0.7083  5.2613 
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)    
## (Intercept)       2.46227    0.20979  11.737  < 2e-16 ***
## New_methods_Tech  0.27647    0.05102   5.418 1.11e-07 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.124 on 358 degrees of freedom
## Multiple R-squared:  0.07579,    Adjusted R-squared:  0.07321 
## F-statistic: 29.36 on 1 and 358 DF,  p-value: 1.107e-07
RandD<-inv_vs_inno$p49
plot(RandD,Innovation)
abline(lm(Innovation~RandD)) 

regresion_linear4<-lm(Innovation~RandD,)
summary(regresion_linear4)
## 
## Call:
## lm(formula = Innovation ~ RandD)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.8583 -0.8583  0.1417  0.6680  5.1943 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   2.5426     0.2135  11.911  < 2e-16 ***
## RandD         0.2631     0.0534   4.928 1.27e-06 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.131 on 358 degrees of freedom
## Multiple R-squared:  0.06353,    Adjusted R-squared:  0.06092 
## F-statistic: 24.29 on 1 and 358 DF,  p-value: 1.271e-06
Forecast_LifeCicle<-inv_vs_inno$p50
plot(Forecast_LifeCicle,Innovation)
abline(lm(Innovation~Forecast_LifeCicle)) 

regresion_linear5<-lm(Innovation~Forecast_LifeCicle,)
summary(regresion_linear5)
## 
## Call:
## lm(formula = Innovation ~ Forecast_LifeCicle)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.8000 -0.8000  0.2000  0.6908  5.0725 
## 
## Coefficients:
##                    Estimate Std. Error t value Pr(>|t|)    
## (Intercept)         2.70941    0.20655  13.117  < 2e-16 ***
## Forecast_LifeCicle  0.21811    0.05111   4.268 2.53e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.14 on 358 degrees of freedom
## Multiple R-squared:  0.04841,    Adjusted R-squared:  0.04575 
## F-statistic: 18.21 on 1 and 358 DF,  p-value: 2.533e-05

To obtain the histograms for dependent variable vs independent variables Dependent: Innovation Independent: Technology

for (i in 1:6) {
  hist(inv_vs_inno[,i])
}