CPS96_15

enara

2025-05-22

## Warning: package 'Rcmdr' was built under R version 4.4.3
## Cargando paquete requerido: splines
## Cargando paquete requerido: RcmdrMisc
## Cargando paquete requerido: car
## Cargando paquete requerido: carData
## Cargando paquete requerido: sandwich
## Cargando paquete requerido: effects
## lattice theme set by effectsTheme()
## See ?effectsTheme for details.
## La interfaz R-Commander sólo funciona en sesiones interactivas
## 
## Adjuntando el paquete: 'Rcmdr'
## The following object is masked from 'package:base':
## 
##     errorCondition
> CPS96_15. <- 
+   readXL("C:/Users/enara/Documents/ADE (USAL)/ECONOMETRÍA/CPS96_15 TRABAJAR BASE DE DATOS BRECHA DE GÉNERO EN INGRESOS SALARIALES.xlsx",
+    rownames=FALSE, header=TRUE, na="", sheet="Sheet1", stringsAsFactors=TRUE)

Resumir el conjunto de datos: CPS96_15.

> summary(CPS96_15.)
      year           ahe            bachelor          female      
 Min.   :1996   Min.   :  1.36   Min.   :0.0000   Min.   :0.0000  
 1st Qu.:1996   1st Qu.: 10.10   1st Qu.:0.0000   1st Qu.:0.0000  
 Median :2015   Median : 14.42   Median :0.0000   Median :0.0000  
 Mean   :2006   Mean   : 17.29   Mean   :0.4812   Mean   :0.4172  
 3rd Qu.:2015   3rd Qu.: 21.15   3rd Qu.:1.0000   3rd Qu.:1.0000  
 Max.   :2015   Max.   :105.77   Max.   :1.0000   Max.   :1.0000  
      age       
 Min.   :25.00  
 1st Qu.:27.00  
 Median :30.00  
 Mean   :29.62  
 3rd Qu.:32.00  
 Max.   :34.00  
> library(abind, pos=16)
> library(e1071, pos=17)

Resúmenes numéricos: CPS96_15.

> numSummary(CPS96_15.[,"bachelor", drop=FALSE], statistics=c("mean", "sd", "IQR", "quantiles"), quantiles=c(0,.25,
+   .5,.75,1))
      mean        sd IQR 0% 25% 50% 75% 100%     n
 0.4811757 0.4996644   1  0   0   0   1    1 13201

Histograma: bachelor

> with(CPS96_15., Hist(bachelor, scale="frequency", breaks="Sturges", col="darkgray"))

Histograma: ahe

> with(CPS96_15., Hist(ahe, scale="frequency", breaks="Sturges", col="darkgray"))

> data(Prestige, package="carData")

Modelo lineal: LinearModel.1: prestige ~ (education +log(income))*type

> LinearModel.1 <- lm(prestige ~ (education +log(income))*type, data=Prestige)
> summary(LinearModel.1)

Call:
lm(formula = prestige ~ (education + log(income)) * type, data = Prestige)

Residuals:
    Min      1Q  Median      3Q     Max 
-13.970  -4.124   1.206   3.829  18.059 

Coefficients:
                      Estimate Std. Error t value Pr(>|t|)    
(Intercept)          -120.0459    20.1576  -5.955 5.07e-08 ***
education               2.3357     0.9277   2.518  0.01360 *  
log(income)            15.9825     2.6059   6.133 2.32e-08 ***
typeprof               85.1601    31.1810   2.731  0.00761 ** 
typewc                 30.2412    37.9788   0.796  0.42800    
education:typeprof      0.6974     1.2895   0.541  0.58998    
education:typewc        3.6400     1.7589   2.069  0.04140 *  
log(income):typeprof   -9.4288     3.7751  -2.498  0.01434 *  
log(income):typewc     -8.1556     4.4029  -1.852  0.06730 .  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 6.409 on 89 degrees of freedom
  (4 observations deleted due to missingness)
Multiple R-squared:  0.871, Adjusted R-squared:  0.8595 
F-statistic: 75.15 on 8 and 89 DF,  p-value: < 2.2e-16

Modelo lineal: LinearModel.2: prestige ~ (education + log(income)) * type

> LinearModel.2 <- lm(prestige ~ (education + log(income)) * type, data=Prestige)
> summary(LinearModel.2)

Call:
lm(formula = prestige ~ (education + log(income)) * type, data = Prestige)

Residuals:
    Min      1Q  Median      3Q     Max 
-13.970  -4.124   1.206   3.829  18.059 

Coefficients:
                      Estimate Std. Error t value Pr(>|t|)    
(Intercept)          -120.0459    20.1576  -5.955 5.07e-08 ***
education               2.3357     0.9277   2.518  0.01360 *  
log(income)            15.9825     2.6059   6.133 2.32e-08 ***
typeprof               85.1601    31.1810   2.731  0.00761 ** 
typewc                 30.2412    37.9788   0.796  0.42800    
education:typeprof      0.6974     1.2895   0.541  0.58998    
education:typewc        3.6400     1.7589   2.069  0.04140 *  
log(income):typeprof   -9.4288     3.7751  -2.498  0.01434 *  
log(income):typewc     -8.1556     4.4029  -1.852  0.06730 .  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 6.409 on 89 degrees of freedom
  (4 observations deleted due to missingness)
Multiple R-squared:  0.871, Adjusted R-squared:  0.8595 
F-statistic: 75.15 on 8 and 89 DF,  p-value: < 2.2e-16

Análisis de varianza: LinearModel.2

> Anova(LinearModel.2, type="II")
Anova Table (Type II tests)

Response: prestige
                 Sum Sq Df F value    Pr(>F)    
education        1209.3  1 29.4446 4.912e-07 ***
log(income)      1690.8  1 41.1670 6.589e-09 ***
type              469.1  2  5.7103  0.004642 ** 
education:type    178.8  2  2.1762  0.119474    
log(income):type  290.3  2  3.5344  0.033338 *  
Residuals        3655.4 89                      
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1