R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

data<-data.frame(
  Q=c(35, 49, 81, 156, 255, 277, 400),
  K=c(1, 1, 4, 4, 8, 12, 15),
  L=c(2, 3, 4, 9, 14, 14, 20)
)

Including Plots

You can also embed plots, for example:

## 
## Call:
## lm(formula = log(Q) ~ log(K) + log(L), data = data)
## 
## Residuals:
##          1          2          3          4          5          6          7 
##  0.0006220  0.0062909 -0.0001398 -0.0063396 -0.0125818 -0.0100704  0.0222187 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  2.98921    0.01983  150.74 1.16e-08 ***
## log(K)       0.19790    0.01646   12.02 0.000274 ***
## log(L)       0.81586    0.02040   39.99 2.34e-06 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.01444 on 4 degrees of freedom
## Multiple R-squared:  0.9998, Adjusted R-squared:  0.9998 
## F-statistic: 1.252e+04 on 2 and 4 DF,  p-value: 2.55e-08
library(car)
## Warning: package 'car' was built under R version 4.5.3
## Cargando paquete requerido: carData
linearHypothesis(model, "log(K) + log(L) = 1")
## 
## Linear hypothesis test:
## log(K)  + log(L) = 1
## 
## Model 1: restricted model
## Model 2: log(Q) ~ log(K) + log(L)
## 
##   Res.Df        RSS Df  Sum of Sq      F Pr(>F)
## 1      5 0.00159124                            
## 2      4 0.00083356  1 0.00075768 3.6359 0.1292

Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.

alpha <- 0.1979
beta <- 0.8159
w <- 25000
r <- 15000

Com <- (w/r) * (alpha/beta)

Com
## [1] 0.4042571
L <- seq(1, 30, by = 1)
K <- Com * L
plot(L, K, type = "l", col = "purple", lwd = 2,
     xlab = "Trabajo (L)",
     ylab = "Capital (K)",
     main = "Senda de Expansión")

A <- exp(2.98921)


c <- (w/r) * (alpha/beta)


Q <- 400


L_opt <- (Q / (A * (c^alpha)))^(1/(alpha + beta))


K_opt <- c * L_opt

L_opt
## [1] 23.06201
K_opt
## [1] 9.322978
L_real <- 20
K_real <- 15

L_seq <- seq(0, 30, length.out = 100) 
K_seq <- c * L_seq

plot(L_seq, K_seq, type = "l", col = "darkblue", lwd = 2,
     xlab = "Trabajo (L)",
     ylab = "Capital (K)",
     main = "Senda de Expansión vs Realidad",
 ylim = c(0, 20))

points(L_opt, K_opt, col = "purple", pch = 19, cex = 2)
points(L_real, K_real, col = "darkgreen", pch = 19, cex = 2)