This function applies a given function to each case of a multiple case scdf, returning a list of the output of each function call.
Details
If simplify is TRUE and the function returns a vector of values, the output
is combined into a data frame with case names as additional columns.
This is particularly useful for applying statistical models or summary statistics to each case in an scdf.
See also
Other data manipulation functions:
add_l2(),
as.data.frame.scdf(),
as_scdf(),
fill_missing(),
moving_median(),
print.sc_outlier(),
ranks(),
rescale(),
scdf(),
select_cases(),
set_vars(),
shift(),
smooth_cases(),
standardize(),
truncate_phase()
Examples
batch_apply(exampleAB, coef(plm(.)))
#> $Johanna
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) 54.400000 3.889690 13.98569074 2.173001e-10
#> mt 0.100000 1.587959 0.06297391 9.505673e-01
#> phaseB 7.858333 5.816499 1.35104178 1.954791e-01
#> interB 1.525000 1.616067 0.94364905 3.593813e-01
#>
#> $Karolina
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) 49.0000000 4.098328 11.9560945 2.169640e-09
#> mt 1.4000000 1.673136 0.8367523 4.150550e-01
#> phaseB 3.8916667 6.128489 0.6350124 5.343967e-01
#> interB 0.5392857 1.702751 0.3167144 7.555551e-01
#>
#> $Anja
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) 56.40000 4.250294 13.2696700 4.729808e-10
#> mt -1.40000 1.735175 -0.8068349 4.315923e-01
#> phaseB 16.96667 6.355733 2.6695057 1.678721e-02
#> interB 2.50000 1.765889 1.4157177 1.760295e-01
#>
