kbenoit / wordshoal

quanteda implementation of the Lauderdale and Herzog (2016) "Wordshoal" model
13 stars 2 forks source link

Issue with the as.wfm function #12

Closed p-lin closed 4 years ago

p-lin commented 6 years ago

Hello, I have been running into a bug with the replication of Lauderdale and Herzog (2016). When running the data analysis section of the 1.1-generate_Dail_estimates.R file in the analysis_replication folder, I run into errors with the "as.wfm" function from the austin package. Specifically, running line 35 and line 64 shows the error, "Error in asMethod(object) : invalid class of object to as_cholmod_sparse". The same error occurs in the Wordshoal9.R file in the analysis_replication/Software folder, with line 193 (specifically, regarding the as.matrix function). I was seemingly able to fix all issues by replacing the as.wfm function and the as.matrix function with "quanteda::as.wfm", and was able to fully complete the replication. Has anyone else encountered this issue, or was able to fix the issue in an alternative way? Cheers, P Lin

lauderdale commented 6 years ago

I suspect that is a bug that has been introduced by changes in the underlying packages. The replication package for that paper worked using the versions of the packages available at the time it was constructed.

BL

On 31 May 2018, at 21:51, p-lin notifications@github.com<mailto:notifications@github.com> wrote:

Hello, I have been running into a bug with the replication of Lauderdale and Herzog (2016). When running the data analysis section of the 1.1-generate_Dail_estimates.R file in the analysis_replication folder, I run into errors with the "as.wfm" function from the austin package. Specifically, running line 35 and line 64 shows the error, "Error in asMethod(object) : invalid class of object to as_cholmod_sparse". The same error occurs in the Wordshoal9.R file in the analysis_replication/Software folder, with line 193 (specifically, regarding the as.matrix function). I was seemingly able to fix all issues by replacing the as.wfm function and the as.matrix function with "quanteda::as.wfm", and was able to fully complete the replication. Has anyone else encountered this issue, or was able to fix the issue in an alternative way? Cheers, P Lin

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/kbenoit/wordshoal/issues/12, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AGYeYUw6RQ3T0YsjxDXsK5-y0CLhXbPYks5t4FfCgaJpZM4UVt2l.

amatsuo commented 6 years ago

I can think about the solution for the issue.

@p-lin Please provide a code and data that generates the error. I know it's somewhere online. You can point me the url.

lauderdale commented 6 years ago

You are not obliged to provide ongoing maintenance updates for the replication package for my paper! : )

On 1 Jun 2018, at 11:48, Aki Matsuo notifications@github.com<mailto:notifications@github.com> wrote:

I can think about the solution for the issue.

@p-linhttps://github.com/p-lin Please provide a code and data that generates the error. I know it's somewhere online. You can point me the url.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/kbenoit/wordshoal/issues/12#issuecomment-393844779, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AGYeYdpOsb7SpRExCtHprO2qOPLd1LKyks5t4RwAgaJpZM4UVt2l.


Benjamin Lauderdale Associate Professor Department of Methodology London School of Economics Columbia House 8.10 Houghton Street London, WC2A 2AE United Kingdom

+44 (0)2071075439 B.E.Lauderdale@lse.ac.ukmailto:B.E.Lauderdale@lse.ac.uk


amatsuo commented 6 years ago

Alright. I'd id it if it seems a simple fix, then.

Thanks!

p-lin commented 6 years ago

Thanks! The issue is most likely coming from updates to the austin package. The austin package seems to have a different method to run the as.wfm function than the quanteda package.

@amatsuo, if you want a look, here is the link to the replication data: https://dataverse.harvard.edu/dataset.xhtml?persistentId=doi:10.7910/DVN/RQMIV3.

The issues are in two files: in the analysis_replication folder, under the file, "1.1-generate_Dail_estimates.R", and in the analysis_replication/Software folder, under the file "Wordshoal9.R".

Again, I was able to fix the issue by changing any of the "as.wfm" or "as.matrix" functions to "quanteda::as.wfm".

Thanks! P Lin