-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calibration with raking method works with CALMAR2 SAS but not with Icarus in R #14
Comments
Hi Emanuele, Thank you very much for your message. It may be difficult to address your issue without having more details (for instance, the number of calibration variables used, are they only numeric?). The algorithm converges with both icarus and SAS (that's good news!). Are the weights from icarus and calmar the same? Have a nice day. Khaled |
HI @khaledlarbi thanks for your reply.
Combining them together I create two new columns of observations: i.e. ctrysize: AT1, AT2, AT3, AT4, BE1, BE2, ... , SK3, SK4 In total there are 48 unique observations for ctrysize and 48 for ctrysect. In total my dataset has 11.699 companies interviewed so these combinations are repated, and I have no missing combinations. Then I have margins, for each unique combination I have the total number of firms (integer) in the Euro Area, so I have two margins columns, one with the totals for each of the 48 ctrysize combinations and one with the totals for each of the 48 ctrysect combinations. The margins columns are in alphabetic order. calibration(data=dataset, marginMatrix=margins, colWeights="weight" But the algorithm doesn't converge with the raking method (I tried to modify also input parameters), with the linear converges but I need to perform the raking, because I have to migrate from SAS (where we use the macro Calmar2 raking method with the same dataset and it works) but I cannot understand why in R the algo doesn't converge. Thanks for the support!!, |
So, if I understood correctly: the algorithm converged in both Can you check that the weights you got from the linear method with icarus fulfill the margin constraints? For instance, if we consider the combination AT1, you need to ensure that the sum of the calibrated weights for units in country AT and size 1 is equal to the margin you provided in the margins matrix. I suggest checking this for all combinations. Does "I have no missing combinations" mean that each combination has at least one unit? Can you provide the code you used to run the calibration with |
Hi, I need to perform a calibration using margins on a dataset of observations.
Now this operation is performed using the macro CALMAR2 in SAS, I tried using the Icarus package but the algorithm doesn't converge.
I checked all the input parameters and they are the same that I use in SAS, with the 'linear' method the algorithm converges but with the raking no.
The text was updated successfully, but these errors were encountered: