anbei die gewünschten Daten.
Code: Alles auswählen
names(Company_description)[2] <- "Company"
myInside_buys <- merge(Insider_buys, Company_description, sort=FALSE)
Code: Alles auswählen
model_predictions_buys <- mapply(FUN=myworkaholic, myInside_buys$Trading_date, myInside_buys$Company_name, SIMPLIFY = FALSE)
model_names_buys <- paste(myInside_buys$Trading_date, myInside_buys$Company_name)
names(model_predictions_buys) <- model_names_buys
Code: Alles auswählen
estimation_models_buys <- lapply(model_predictions_buys, '[[', "M")
Leider kann ich str(estimation_models_buys) nicht komplett hierein kopieren, da es sehr sehr lang ist, aber ich habe mal eine Probe genommen.
Das ganze mal 774 und du kannst dir vorstellen was gerade in meiner Console los war.$ 2017-02-23 Bayer :List of 12
..$ coefficients : Named num [1:2] -0.000369 0.876012
.. ..- attr(*, "names")= chr [1:2] "(Intercept)" "DAX"
..$ residuals : Named num [1:180] 0.001825 0.005941 -0.071227 -0.000567 -0.042486 ...
.. ..- attr(*, "names")= chr [1:180] "1" "2" "3" "4" ...
..$ effects : Named num [1:180] -0.0062 -0.13157 -0.07078 -0.00113 -0.04232 ...
.. ..- attr(*, "names")= chr [1:180] "(Intercept)" "DAX" "" "" ...
..$ rank : int 2
..$ fitted.values: Named num [1:180] -0.00591 0.00432 -0.01345 0.01031 -0.00691 ...
.. ..- attr(*, "names")= chr [1:180] "1" "2" "3" "4" ...
..$ assign : int [1:2] 0 1
..$ qr :List of 5
.. ..$ qr : num [1:180, 1:2] -13.4164 0.0745 0.0745 0.0745 0.0745 ...
.. .. ..- attr(*, "dimnames")=List of 2
.. .. .. ..$ : chr [1:180] "1" "2" "3" "4" ...
.. .. .. ..$ : chr [1:2] "(Intercept)" "DAX"
.. .. ..- attr(*, "assign")= int [1:2] 0 1
.. ..$ qraux: num [1:2] 1.07 1.03
.. ..$ pivot: int [1:2] 1 2
.. ..$ tol : num 1e-07
.. ..$ rank : int 2
.. ..- attr(*, "class")= chr "qr"
..$ df.residual : int 178
..$ xlevels : Named list()
..$ call : language lm(formula = as.formula(paste0(Comp, " ~ DAX")), data = Daily_returns[(i.TDAY - 200):(i.TDAY - 21), ])
..$ terms :Classes 'terms', 'formula' language Bayer ~ DAX
.. .. ..- attr(*, "variables")= language list(Bayer, DAX)
.. .. ..- attr(*, "factors")= int [1:2, 1] 0 1
.. .. .. ..- attr(*, "dimnames")=List of 2
.. .. .. .. ..$ : chr [1:2] "Bayer" "DAX"
.. .. .. .. ..$ : chr "DAX"
.. .. ..- attr(*, "term.labels")= chr "DAX"
.. .. ..- attr(*, "order")= int 1
.. .. ..- attr(*, "intercept")= int 1
.. .. ..- attr(*, "response")= int 1
.. .. ..- attr(*, ".Environment")=<environment: 0x00000000150741e0>
.. .. ..- attr(*, "predvars")= language list(Bayer, DAX)
.. .. ..- attr(*, "dataClasses")= Named chr [1:2] "numeric" "numeric"
.. .. .. ..- attr(*, "names")= chr [1:2] "Bayer" "DAX"
..$ model :'data.frame': 180 obs. of 2 variables:
.. ..$ Bayer: num [1:180] -0.00408 0.01026 -0.08467 0.00974 -0.04939 ...
.. ..$ DAX : num [1:180] -0.00632 0.00535 -0.01493 0.01219 -0.00746 ...
.. ..- attr(*, "terms")=Classes 'terms', 'formula' language Bayer ~ DAX
.. .. .. ..- attr(*, "variables")= language list(Bayer, DAX)
.. .. .. ..- attr(*, "factors")= int [1:2, 1] 0 1
.. .. .. .. ..- attr(*, "dimnames")=List of 2
.. .. .. .. .. ..$ : chr [1:2] "Bayer" "DAX"
.. .. .. .. .. ..$ : chr "DAX"
.. .. .. ..- attr(*, "term.labels")= chr "DAX"
.. .. .. ..- attr(*, "order")= int 1
.. .. .. ..- attr(*, "intercept")= int 1
.. .. .. ..- attr(*, "response")= int 1
.. .. .. ..- attr(*, ".Environment")=<environment: 0x00000000150741e0>
.. .. .. ..- attr(*, "predvars")= language list(Bayer, DAX)
.. .. .. ..- attr(*, "dataClasses")= Named chr [1:2] "numeric" "numeric"
.. .. .. .. ..- attr(*, "names")= chr [1:2] "Bayer" "DAX"
..- attr(*, "class")= chr "lm"
Vielen Dank nochmal,
Damian