[R-sig-ME] MCMCglmm error message:Error in `[.data.frame undefined columns selected
PATRICK, Samantha
spatrick at glos.ac.uk
Tue Jun 24 13:51:53 CEST 2014
Hi
I am having problems with an error message in MCMCglmm. I am trying to partition the variance in the model so that each group has its own estimated variance. Originally I had a more complicated model but I have simplified it below to show the source of the problem (so the prior is not optimised for this model and only part of the data set is given). If I fit random = ~GroupA, it runs ok, but if I add in ~us (GroupA):units it gives the error:
Error in `[.data.frame`(data, , components$rterms[select.terms]) :
undefined columns selected
Previous posts have suggested it may be because the variables do not exist but it is not this. I have tried other variants but I keep getting the same error. I have changed all the variable names in case there was a double with a function but still no luck.
Does anyone have any ideas? The same error occurs if you just try to fit the rcov statement (with units). I thought there could be a problem estimating the units term perhaps and so it can not find the residual variance. But if I try other terms in its place I get the same error
Thanks
Sam
Script
library(MCMCglmm)
prior2.1 <- list(R = list(V= 1, nu =0.002), G = list(G1 = list(V =diag(4), nu = 1.002)))
mod2.1<- MCMCglmm(DistanceA ~FixedA, random = ~us(GroupA):units,
# rcov = ~idh(GroupA):units,
prior = prior2.1,
data=h,
pr=TRUE, burnin = 200, nitt = 5000000, thin = 200)
Data
IDA DistanceA FixedA GroupA
1 35.76203413 12 A
1 353.8044206 26 A
1 28.6894637 14 A
1 302.9190056 16 A
1 308.7219701 23 A
2 173.9284996 111 B
2 231.2895313 37 B
2 223.0156577 11 B
2 257.7869899 27 B
3 308.3258686 110 A
3 178.3784977 37 A
3 218.3712172 15 A
4 288.5865862 65 B
5 54.62104181 20 A
5 310.5786671 118 A
5 185.3627266 18 A
5 300.8304258 51 A
6 461.4315924 75 B
6 496.403949 52 B
7 708.2367263 181 B
7 214.8704587 35 B
8 183.6161529 44 A
8 183.326292 21 A
8 319.0479119 39 A
9 269.6319359 79 B
9 325.1318986 98 B
9 399.208417 99 B
10 135.2138385 50 B
10 162.9959776 67 B
11 49.05385099 17 A
11 80.92750054 26 A
11 184.7205464 16 A
12 327.6768626 47 A
29 240.6830677 85 C
29 126.9140906 23 C
29 216.4021125 29 C
29 168.8125168 52 C
30 230.8613452 25 D
30 134.8893388 38 D
30 164.2181205 48 D
30 140.8627105 55 D
31 15.51295239 6 D
31 42.45851533 3 D
31 16.30773693 4 D
31 89.57289202 20 D
31 108.0256345 115 D
32 118.2199077 12 D
32 247.9492249 26 D
32 18.20298953 15 D
32 70.97933919 20 D
32 109.7264855 36 D
32 101.8653273 19 D
32 68.54583069 7 D
33 24.1465819 7 C
33 67.33233486 75 C
33 64.92951246 31 C
33 94.90538004 53 C
34 474.3625341 171 C
54 150.6926733 43 D
54 191.6157478 58 D
54 127.1248342 14 D
55 385.2042737 42 D
55 202.8058375 23 D
55 144.4546654 44 D
56 194.0171206 81 D
56 163.6960289 40 D
57 122.5337279 89 D
57 172.2405156 44 D
57 206.4998878 79 D
57 122.677563 19 D
58 147.3699167 31 D
59 140.7191172 84 D
59 241.2723386 50 D
59 230.1874477 83 D
60 130.6675375 101 D
60 104.4518299 9 D
60 134.473374 56 D
61 135.7597774 17 D
61 232.3798885 40 D
62 164.1352534 65 D
62 259.1312989 28 D
63 177.8687393 145 C
63 121.3886107 43 C
64 202.009693 43 D
64 218.7044853 41 D
Dr Samantha Patrick
Research Fellow
Biosciences QU116
Francis Close Hall Campus
University of Gloucestershire
Cheltenham
GL50 4AZ
UK
Research Associate: ABRG, University of Oxford
Tel : +44 1242 714 668
Skype: sammy_patrick
________________________________________
-
‘In the top 5 in the Green League Table; committed to sustainability’
This email is confidential to the intended recipient. If you have received it in error please notify the sender and delete it from your computer.
The University of Gloucestershire is a company limited by guarantee registered in England and Wales. Registered number: 06023243. Registered office: The Park, Cheltenham, GL50 2RH
Please consider the environment before printing this email.
-
More information about the R-sig-mixed-models
mailing list