Giter Club home page Giter Club logo

coinr6's Introduction

COINr6

This is an archived version of COINr which can be installed as a separate package called "COINr6".

After COINr 0.6.1, major changes in syntax and functionality were introduced. This was a one-off abrupt change to improve the package but is obviously disruptive. For users who would prefer to continue using the old version, or would like to use both the old and new versions simultaneously, I have archived COINr v.0.6.1 here under the name "COINr6". By naming the package differently, it can be installed alongside the new COINr if needed.

To install, run:

devtools::install_github("bluefoxr/COINr6")

coinr6's People

Contributors

bluefoxr avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

petrina95

coinr6's Issues

Individual treatment not working properly

Hello and thank you once again for taking the time to build this library!

I am in the process of developing this year's Index and I need to perform outlier treatment. I have been using the Coinr6:: treat() function with specifying individual treatment for some of the indicators.

The code is the following:

individual = data.frame(
  IndCode = c("IND_1","IND_4","IND_6","IND_32","IND_15","IND_22","IND_27","IND_26","IND_28","IND_30","IND_36","IND_37"),
  Treat = c("win", "win", "win", "win", "win", "win", "win", "win", "win", "win", "win", "win"),
  Winmax = c(2,1,1,2,1,1,2,2,1,1,2,1),
  Thresh = c(NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  Boxlam = c(NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA)
)

coin<- treat(coin, dset = "Raw", individual = individual,
              indiv_only = TRUE)

However there are two cases where the treatment does not work as expected.

  1. In the first case indicator 1 is flagged with 1 Low outlier and even if I have forced it to winsorise 2 points it winsorise only 1, as you can see in the picture.

image

I managed to find a workaround by setting the threshold for skew and kurtosis to t_skew=-0.2, t_kurt=-0.5 only for this indicator, so the code now is the following:

individual = data.frame(
  IndCode = c("IND_1","IND_4","IND_6","IND_32","IND_15","IND_22","IND_27","IND_26","IND_28","IND_30","IND_36","IND_37"),
  Treat = c("win", "win", "win", "win", "win", "win", "win", "win", "win", "win", "win", "win"),
  Winmax = c(2,1,1,2,1,1,2,2,1,1,2,1),
  # thres was added as a workaround to treat both points for indicator 1, otherwise it would treat only 1 point
  Thresh = c("thresh", NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  Boxlam = c(NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA)
)

#coin<- treat(coin, dset = "Raw", individual = individual,
#              indiv_only = TRUE)

coin<- treat(coin, dset = "Raw", individual = individual,
                 indiv_only = TRUE, t_skew=-0.2, t_kurt=-0.5)
  1. In the second case, indicator 36 is flagged with 3 outliers and since I have forced to treat 2 points it seems that the winsored points are 2.

image

However, when I look at coin$Analysis$Treated$TreatFlags, there are three points that have been flagged and searching further into coin$Data$Treated I confirm that 3 points have been treated and not 2.

Do you know what could be the issue?

When does an outlier is flagged in coin$Analysis$Treated$TreatFlags if we specified not to check any thresholds setting Thresh to NA?

Moreover, is there the possibility to pass two different thresholds for skew and kurtosis, to force in this way the treatment on the points I need to treat?

I know that COINr is a more updated package, however I have also tried using Treat() function with specifying individual treatment, and it does not seem to work as I have also uploaded at [bluefoxr/COINr/issues/53] .

Thank you in advance,
Petrina

Imputation using imtype = "EM" and EMaglev = 1 returning "Error in .subset2(x, i, exact = exact) : attempt to select less than one element in get1index <real>"

Hello again!
I am trying to impute the missing data of my data set using EM aggregation type on aggregation level 1. However, there is an error that I think comes from the fact that we try to select an element from a list using agg_cols[[0]] syntax (line 279 in coin_impute.R). Is there a quick fix for this issue?
I understand that COINr is a more updated package and today I have tried to convert our COINr6 script to a corresponding script using COINr, however I have noticed that many of the functionalities we are currently using in COINr6 are missing from COINr (imputation using regression, mixed aggregation per level, Unit reports etc.), that is why for now we prefer using COINr6.

Thank you in advance,
Petrina

Incorrect order of Indicators and Effective Weights in effectiveWeight() function

Hello everyone!

First of all, thank you for this package. In the beginning of a project concerning the construction of a composite indicator, we had no idea about the package, and we didn't know how we were going to perform all the steps needed. The package seems to cover all essential steps of the COIN methodology, with really useful functions and plots. Moreover, following the easy-to-use and informative documentation, we had no issue on installing the package and run the available commands on our dataset.

However, we encountered a small issue in the effectiveWeight() function and more specifically with the results of $EffectiveWeightsList. The file with the aggregation metadata (IndAggMeta) that we passed had no row-order in the Code column, meaning that we didn't have first the indicators, then the subareas, then the areas and lastly the index, but the order was random (1st row: Index, 2nd row: Subarea 1, 3rd row: Area1 etc.). This resulted in having inconsistencies when deriving the weights from $EffectiveWeightsList, as the Code column had the row-order of the $LabelsParents$Labels (first all indicators, then subareas, then areas and lastly the Index) and the effective weights column had the row-order of the IndAggMeta file.

We managed to overcome this issue by binding the EffWeights$LabelsParents$Labels, EffWeights$EffectiveWeights, however I think that the issue should be addressed, or in the documentation it should be specified that the order of rows in the AggMeta file is important.

Thank you in advance!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.