SCM

[#6805] Bug in eRm::RSM (sum0 has no effect)

Date:
2023-04-26 20:26
Priority:
3
State:
Open
Submitted by:
Rainer Alexandrowicz (rwa)
Assigned to:
Nobody (None)
Hardware:
None
Product:
None
Operating System:
None
Component:
None
Version:
None
Severity:
None
Resolution:
None
URL:
Summary:
Bug in eRm::RSM (sum0 has no effect)

Detailed description
I have a data set, for which the sum0-option seems to have no effect (attached below). However, using the data set provided in the package, everything works fine:

# Here the example data set:

library(eRm)
data(pcmdat2) # from package
rsm1 = RSM(pcmdat2,sum0=TRUE)
rsm2 = RSM(pcmdat2,sum0=FALSE)
plotPImap(rsm1) # ok
plotPImap(rsm2)


# Now the problem:

pcm_data = read.csv("pcm_data.csv", header=TRUE, sep=";")[,-1]
rsm1 = RSM(pcm_data,sum0=TRUE)
rsm2 = RSM(pcm_data,sum0=FALSE)
plotPImap(rsm1) # ???
plotPImap(rsm2)

Taking a closer look at the x-axis, we find in both diagrams the identical values. This contradicts the intended effect of the sum0-option. There might be a problem with the W matrix of this data set, etas 4-7 are not sum0-normed (thanks to MJM for this hint!):


> rsm1$W

eta 1 eta 2 eta 3 eta 4 eta 5 eta 6 eta 7
beta V1.c1 -1 -1 -1 0 0 0 0
beta V1.c2 -2 -2 -2 1 0 0 0
beta V1.c3 -3 -3 -3 0 1 0 0
beta V1.c4 -4 -4 -4 0 0 1 0
beta V1.c5 -5 -5 -5 0 0 0 1
beta V2.c1 1 0 0 0 0 0 0
beta V2.c2 2 0 0 1 0 0 0
beta V2.c3 3 0 0 0 1 0 0
beta V2.c4 4 0 0 0 0 1 0
beta V2.c5 5 0 0 0 0 0 1
beta V3.c1 0 1 0 0 0 0 0
beta V3.c2 0 2 0 1 0 0 0
beta V3.c3 0 3 0 0 1 0 0
beta V3.c4 0 4 0 0 0 1 0
beta V3.c5 0 5 0 0 0 0 1
beta V4.c1 0 0 1 0 0 0 0
beta V4.c2 0 0 2 1 0 0 0
beta V4.c3 0 0 3 0 1 0 0
beta V4.c4 0 0 4 0 0 1 0
beta V4.c5 0 0 5 0 0 0 1


Comments:

No Comments Have Been Posted

Attached Files:

Attachments:
Size Name Date By Download
30 KiBpcm_data.csv2023-04-26 20:26rwapcm_data.csv

Changes

Field Old Value Date By
File Added5217: pcm_data.csv2023-04-26 20:26rwa
Thanks to:
Vienna University of Economics and Business Powered By FusionForge