VPC not printing

Welcome to the forum for R2MLwiN users. Feel free to post your question about R2MLwiN here. The Centre for Multilevel Modelling take no responsibility for the accuracy of these posts, we are unable to monitor them closely. Do go ahead and post your question and thank you in advance if you find the time to post any answers!

Go to R2MLwiN: Running MLwiN from within R >> http://www.bris.ac.uk/cmm/software/r2mlwin/
Post Reply
dcanarteg
Posts: 14
Joined: Tue Feb 05, 2019 9:30 pm

VPC not printing

Post by dcanarteg »

Hello

I just started using R2MLwiN and I am replicating Zhang's et al (2016) R2MLwiN example (Page 8). I don't know why the Variance Partition Coefficient is not Printing. This is my code, and as I see here it should print the result as soon as I run it

# Variance Partition Coefficient (VPC) by pulling relevant slot "RP" -random part -of this S4 class object
print(VPC <- VarCompModel["RP"] [["RP2_var_Intercept"]] /
(VarCompModel["RP"] [["RP1_var_Intercept"]] + (VarCompModel["RP"] [["RP2_var_Intercept"]]))

And it should yield
[1] 0.1659064

What can I do?
David
ChrisCharlton
Posts: 1351
Joined: Mon Oct 19, 2009 10:34 am

Re: VPC not printing

Post by ChrisCharlton »

We provide an example script to replicate all of the examples in this paper at:
http://bristol.ac.uk/cmm/media/r2mlwin/jss.R

along with the output when this is run:
http://bristol.ac.uk/cmm/media/r2mlwin/jss.Rout

As you can see the VPC is correctly printed here, so my suggestion would be to compare your code with this to see if you can find any differences. It might also be worth running this example code on your system to see whether your output matches that provided here.
dcanarteg
Posts: 14
Joined: Tue Feb 05, 2019 9:30 pm

Re: VPC not printing

Post by dcanarteg »

Thank you I will try this asap
dcanarteg
Posts: 14
Joined: Tue Feb 05, 2019 9:30 pm

Re: VPC not printing

Post by dcanarteg »

I fixed it. Thanks
Post Reply