if(requireNamespace("AER")){
require(AER)
data("OECDGrowth")
## The scales in OECDGrowth differ hence using the correlation matrix is
## highly recommended.
pla(OECDGrowth, thresholds=0.5) ## not recommended
pla(OECDGrowth, cor=TRUE, thresholds=0.5)
## We obtain three blocks: (randd), (gdp85, gdp60) and (invest, school,
## popgrowth). Block 1, i.e. the 1x1 block (randd), explains only 5.76% of
## the overall variance. Hence, discarding this block seems appropriate.
pla_obj = pla(OECDGrowth, cor=TRUE, thresholds=0.5)
pla.drop_blocks(pla_obj, c(1)) ## drop block 1
## Sometimes, considering the blocks we keep rather than the blocks we want
## to discard might be more convenient.
pla.keep_blocks(pla_obj, c(2,3)) ## keep block 2 and block 3
}
Run the code above in your browser using DataLab