[R] Using randtest in rlq works for one dataset, but not for the other....

Jacqueline loos at leuphana.de
Thu Apr 9 15:23:53 CEST 2015


Dear knowledgeable people, 

I am running rlq analyses for two different datasets. Even though these
datasets are quite similar, for one of them I receive the error: "Error in
randtest.rlq(xtest, modeltype = 2, nrepet = nrepet, ...) : 
  Not yet available" when applying randtest(pres.rlq) 

My first dataset, for which the test works, looks like this: 
> str(birdsX)
'data.frame':	116 obs. of  51 variables:
 $ Acrocephalus_palustris       : int  1 0 0 0 0 0 0 0 0 0 ...
 $ Aegithalos_caudatus          : int  0 0 0 0 0 0 0 0 1 1 ...
 $ Alauda_arvensis              : int  0 1 0 1 1 1 0 0 0 0 ...
 $ Anthus_campestris            : int  0 0 0 0 0 0 0 0 0 0 ...
 $ Anthus_trivialis             : int  0 1 0 0 0 1 1 0 0 0 ...
 $ Carduelis_cannabina          : int  0 0 0 0 0 0 0 0 0 0 ...
 $ Carduelis_carduelis          : int  0 0 0 0 0 0 0 0 0 0 ...
 $ Carduelis_chloris            : int  0 0 0 0 0 0 0 0 0 0 ...
 $ Coccothraustes_coccothraustes: int  0 1 0 0 0 0 1 0 0 1 ...
 $ Columba_palumbus             : int  0 0 0 0 0 0 0 0 0 0 ...
 $ Crex_crex                    : int  0 0 0 0 0 0 0 0 0 0 ...
 $ Emberiza_calandra            : int  0 1 0 0 0 0 0 0 0 0 ...
 $ Emberiza_citrinella          : int  0 1 1 0 1 1 1 0 1 0 ...
 $ Erithacus_rubecula           : int  0 0 1 0 0 0 0 0 0 0 ...
 $ Fringilla_coelebs            : int  0 0 0 0 0 0 0 0 1 0 ...
 $ Garrulus_glandarius          : int  0 0 0 0 0 0 0 0 1 0 ...
 $ Hippolais_pallida            : int  0 0 0 0 0 0 0 0 0 0 ...
 $ Lanius_collurio              : int  0 0 1 0 0 1 0 0 0 0 ...
 $ Lanius_excubitor             : int  0 0 0 0 0 0 0 0 0 0 ...
 $ Lanius_minor                 : int  0 0 0 0 0 0 0 0 0 0 ...
 $ Locustella_fluviatilis       : int  0 0 0 0 0 0 0 0 1 0 ...
 $ Lullula_arborea              : int  0 0 0 0 0 0 0 0 0 0 ...
 $ Luscinia_luscinia            : int  0 0 0 0 0 0 0 0 1 1 ...
 $ Motacilla_alba               : int  1 0 0 0 0 0 0 0 0 0 ...
 $ Motacilla_flava              : int  0 0 0 0 0 0 0 0 0 0 ...
 $ Oriolus_oriolus              : int  1 0 0 0 0 0 0 0 0 0 ...
 $ Parus_caeruleus              : int  0 0 0 0 0 0 0 0 1 0 ...
 $ Parus_major                  : int  1 1 1 0 0 0 1 0 1 0 ...
 $ Parus_palustris              : int  0 0 1 0 0 0 0 0 1 0 ...
 $ Passer_domesticus            : int  0 0 0 0 0 0 0 0 0 0 ...
 $ Passer_montanus              : int  0 0 1 0 0 0 0 0 0 0 ...
 $ Phylloscopus_collybita       : int  0 1 0 0 0 0 1 0 1 0 ...
 $ Phylloscopus_sibilatrix      : int  0 0 0 0 0 0 0 0 0 0 ...
 $ Phylloscopus_trochilus       : int  0 0 0 0 0 0 0 0 0 0 ...
 $ Pica_pica                    : int  0 0 0 0 0 0 0 0 0 0 ...
 $ Picus_canus                  : int  0 0 0 0 0 0 0 0 0 0 ...
 $ Picus_viridis                : int  0 0 0 0 0 0 0 0 0 0 ...
 $ Saxicola_rubetra             : int  0 0 0 0 1 0 0 1 0 0 ...
 $ Saxicola_torquata            : int  0 0 0 0 0 0 0 0 0 0 ...
 $ Sitta_europea                : int  0 0 0 0 0 0 0 0 0 0 ...
 $ Sturnus_vulgaris             : int  0 0 0 0 0 0 0 0 1 1 ...
 $ Sylvia_atricapilla           : int  1 0 1 0 0 0 0 0 1 0 ...
 $ Sylvia_borin                 : int  1 0 0 0 0 0 1 0 0 1 ...
 $ Sylvia_communis              : int  1 1 0 0 0 0 0 0 0 0 ...
 $ Sylvia_curruca               : int  0 0 0 0 0 0 0 0 0 1 ...
 $ Sylvia_nisoria               : int  0 0 0 0 0 0 0 0 0 0 ...
 $ Troglodytes_troglodytes      : int  0 0 0 0 0 0 0 0 0 0 ...
 $ Turdus_merula                : int  0 0 0 0 0 0 1 0 0 0 ...
 $ Turdus_philomelos            : int  0 0 0 0 0 0 0 0 0 0 ...
 $ Turdus_viscivorus            : int  0 0 0 0 0 0 0 0 0 0 ...
 $ Upupa_epops                  : int  0 0 0 0 0 0 0 0 0 0 ...
> str(traitX)
'data.frame':	51 obs. of  15 variables:
 $ family               : Factor w/ 25 levels "Buntings","Chats",..: 23 20 7
13 13 4 4 4 21 4 ...
 $ habitat              : Factor w/ 5 levels "aquatic","forest",..: 3 3 4 4
3 4 3 3 2 3 ...
 $ nest_location.cosmin : Factor w/ 4 levels "ground","herbaceous",..: 2 4 1
1 1 3 4 3 4 4 ...
 $ type_of_nest_._cosmin: Factor w/ 4 levels
"build_nest","escavate_hollow",..: 4 1 4 4 4 4 4 4 3 4 ...
 $ diet                 : Factor w/ 8 levels "Aerial_insect",..: 8 2 6 4 2 7
7 6 2 7 ...
 $ diet.cosmin          : Factor w/ 4 levels "carnivorous",..: 2 3 3 2 2 4 4
3 2 4 ...
 $ migratory_Cosmin     : Factor w/ 3 levels "long","resident",..: 1 2 1 1 1
2 2 2 2 2 ...
 $ foraging_technique.  : Factor w/ 12 levels "bark_forager",..: 12 12 6 6 6
11 11 10 1 11 ...
 $ homerange            : Factor w/ 3 levels "1-4ha","less1ha",..: 2 2 2 2 2
2 2 2 2 2 ...
 $ bodysize             : Factor w/ 6 levels "100-500g","15-24g",..: 5 5 3 2
2 2 2 3 5 4 ...
 $ clutchsize           : Factor w/ 3 levels "3-6eggs","less3eggs",..: 1 3 1
1 1 1 1 1 1 1 ...
 $ laying_date          : Factor w/ 7 levels "Early_April",..: 6 1 1 6 2 3 3
3 6 1 ...
 $ rarity               : Factor w/ 3 levels "75-95%","less75%",..: 2 1 1 1
2 3 3 3 2 1 ...
 $ national_trend       : Factor w/ 5 levels "increasing","Increasing",..: 4
4 3 4 4 1 4 3 4 4 ...
 $ Ecological_type      : Factor w/ 4 levels
"Farmland_whit_bushes_and_trees",..: 3 2 3 3 1 1 1 1 2 2 ...
> str(envir)
'data.frame':	116 obs. of  13 variables:
 $ woody_1ha    : num  0.349 0.247 0.439 -1.24 -1.24 ...
 $ spot_1ha     : num  -0.154 -0.308 0.91 -0.308 1.263 ...
 $ TWI          : num  1.773 -0.641 -0.297 0.459 1.21 ...
 $ heatload     : num  0.788 -0.986 -1.24 0.366 0.704 ...
 $ sidi_50ha    : num  -1.846 0.622 -1.115 -1.267 0.346 ...
 $ woody_50ha   : num  -0.381 1.443 0.476 -1.857 -1.286 ...
 $ rugg_50ha    : num  -1.2455 0.6073 0.197 -0.6771 -0.0291 ...
 $ ed_50ha      : num  -1.122 0.715 -0.407 -0.509 0.409 ...
 $ woodypercatch: num  0.586 0.586 0.586 -1.063 -1.063 ...
 $ catch_rugged : num  0.227 0.227 0.227 2.048 2.048 ...
 $ Edfine       : num  0.902 0.902 0.902 0.434 0.434 ...
 $ SIDIfine     : num  0.739 0.739 0.739 -0.407 -0.407 ...
 $ pastpercatch : num  -1.141 -1.141 -1.141 0.679 0.679 ...

> summary(pres.rlq)

Eigenvalues decomposition:
        eig     covar      sdR      sdQ      corr
1 1.9050088 1.3802205 1.730708 2.194411 0.3634181
2 0.3471101 0.5891605 1.156380 1.889246 0.2696775

Inertia & coinertia R:
    inertia      max     ratio
1  2.995351 3.379328 0.8863749
12 4.332566 5.234932 0.8276260

Inertia & coinertia Q:
    inertia      max     ratio
1  4.815442  6.36944 0.7560228
12 8.384691 12.42140 0.6750197

Correlation L:
       corr       max     ratio
1 0.3634181 0.7633403 0.4760892
2 0.2696775 0.6986529 0.3859963




The second one, for which it doesn´t work, looks like this: 

str(buttX)
'data.frame':	120 obs. of  88 variables:
 $ Aglais_urticae       : num  0 0 0 0 0 0 0 0 0 0 ...
 $ Antocharis_cardamines: num  0 0 0 0 0 0 0 0 0 0 ...
 $ Apatura_ilia         : num  0 0 0 0 0 0 0 0 0 0 ...
 $ Apatura_iris         : num  0 0 0 0 0 0 0 0 0 0 ...
 $ Aphantopus_hyperantus: num  0 1 1 1 0 1 1 0 1 1 ...
 $ Aporia_crataegi      : num  0 0 1 0 0 0 0 0 0 0 ...
 $ Araschnia_levana     : num  0 0 0 0 0 0 0 0 0 0 ...
 $ Argynnis_adippe      : num  0 0 0 0 0 0 0 0 0 0 ...
 $ Argynnis_aglaja      : num  0 0 0 1 0 1 1 0 0 0 ...
 $ Argynnis_niobe       : num  0 0 0 0 0 1 0 0 0 0 ...
 $ Argynnis_paphia      : num  1 1 0 0 0 0 1 0 1 0 ...
 $ Aricia_agestis       : num  0 0 0 0 0 0 0 0 1 0 ...
 $ Aricia_artaxerxes    : num  0 0 0 0 0 0 0 0 0 0 ...
 $ Boloria_dia          : num  0 0 0 0 1 1 1 0 0 0 ...
 $ Boloria_euphrosyne   : num  0 0 0 0 0 0 0 0 0 0 ...
 $ Boloria_selene       : num  0 0 1 0 0 1 0 0 0 0 ...
 $ Brenthis_daphne      : num  0 0 0 0 0 0 0 0 1 0 ...
 $ Brenthis_ino         : num  0 0 0 0 0 0 0 0 0 0 ...
 $ Aulocera_circe       : num  0 0 0 0 0 1 0 0 0 0 ...
 $ Callophrys_rubi      : num  0 0 0 0 1 0 0 0 0 0 ...
 $ Celastrina_argiolus  : num  0 0 0 0 0 0 0 0 1 0 ...
 $ Coenonympha_arcania  : num  0 0 0 0 0 0 0 0 0 0 ...
 $ Coenonympha_glycerion: num  0 1 1 1 1 1 0 0 1 1 ...
 $ Coenonympha_pamphilus: num  1 1 1 1 1 1 1 0 1 1 ...
 $ Colias_alfacariensis : num  0 0 0 0 0 0 0 0 0 0 ...
 $ Colias_croceus       : num  1 0 0 0 1 0 0 0 0 0 ...
 $ Colias_hyale         : num  0 0 0 0 0 0 0 0 0 0 ...
 $ Cupido_minimus       : num  0 0 0 0 0 0 0 0 0 0 ...
 $ Cyaniris_semiargus   : num  0 0 0 0 0 0 0 0 0 0 ...
 $ Erebia_medusa        : num  0 0 0 0 0 0 0 0 0 0 ...
 $ Erynnis_tages        : num  0 0 0 0 1 0 1 1 1 0 ...
 $ Aricia_eumedon       : num  0 0 0 0 0 0 0 0 0 0 ...
 $ Euphydryas_aurinia   : num  0 0 0 0 0 1 0 0 0 0 ...
 $ Cupido_argiades      : num  0 1 1 1 1 0 0 0 1 0 ...
 $ Glaucopsyche_alexis  : num  0 0 0 0 0 0 0 0 0 0 ...
 $ Gonepteryx_rhamni    : num  0 0 0 0 0 0 0 0 0 0 ...
 $ Hamearis_lucina      : num  0 0 0 0 0 0 0 0 0 0 ...
 $ Hesperia_comma       : num  0 1 1 1 1 1 0 0 0 0 ...
 $ Heteropterus_morpheus: num  0 0 0 0 0 0 0 0 1 0 ...
 $ Inachis_io           : num  0 0 0 0 0 0 0 0 0 0 ...
 $ Iphiclides_podalirius: num  0 0 0 1 1 0 1 0 0 0 ...
 $ Issoria_lathonia     : num  0 0 0 0 0 0 0 0 0 0 ...
 $ Lasiommata_megera    : num  0 0 0 0 0 0 1 0 0 0 ...
 $ Leptidea_sinapis     : num  1 1 1 1 1 1 1 0 0 1 ...
 $ Limenitis_camilla    : num  0 0 0 0 0 0 0 0 0 0 ...
 $ Lopinga_achine       : num  0 0 0 0 0 0 0 0 0 0 ...
 $ Lycaena_alciphron    : num  0 0 0 0 0 0 0 0 0 0 ...
 $ Lycaena_dispar       : num  0 0 0 0 0 0 0 0 0 1 ...
 $ Lycaena_phlaeas      : num  0 0 0 0 0 0 0 0 0 0 ...
 $ Lycaena_tityrus      : num  0 1 0 0 0 0 0 0 0 0 ...
 $ Lycaena_virgaureae   : num  0 1 0 0 0 0 0 0 0 0 ...
 $ Polyommatus_bellargus: num  0 0 0 0 0 0 0 0 0 0 ...
 $ Maculinea_arion      : num  0 0 0 0 0 0 0 0 0 0 ...
 $ Maniola_jurtina      : num  1 1 1 1 1 1 1 1 1 1 ...
 $ Melanargia_galathea  : num  0 1 1 1 1 1 1 0 1 1 ...
 $ Polyommatus_daphnis  : num  0 0 0 0 0 0 0 0 0 0 ...
 $ Melitaea_athalia     : num  0 0 1 0 0 1 0 0 1 1 ...
 $ Melitaea_aurelia     : num  0 0 0 0 0 0 1 0 1 1 ...
 $ Melitaea_britomartis : num  0 0 1 0 0 0 0 0 0 0 ...
 $ Melitaea_cinxia      : num  0 0 0 0 0 0 0 0 0 0 ...
 $ Melitaea_diamina     : num  0 0 0 0 0 0 0 0 0 0 ...
 $ Melitaea_didyma      : num  0 0 0 0 0 0 1 0 0 0 ...
 $ Melitaea_phoebe      : num  0 0 0 0 0 1 0 0 0 0 ...
 $ Minois_dryas         : num  1 0 1 0 0 1 1 0 0 0 ...
 $ Nymphalis_antiopa    : num  0 0 0 0 0 0 0 0 0 0 ...
 $ Ochlodes_sylvanus    : num  0 0 0 0 0 0 0 0 0 0 ...
 $ Papilio_machaon      : num  0 0 0 1 0 0 0 0 0 0 ...
 $ Pieris_brassicae     : num  1 0 0 0 0 0 0 1 0 0 ...
 $ Pieris_napi          : num  0 0 1 0 0 0 0 0 0 0 ...
 $ Pieris_rapae         : num  1 1 0 1 0 0 0 0 1 0 ...
 $ Plebejus_argus       : num  1 1 1 1 1 1 1 1 1 1 ...
 $ Plebejus_argyrognomon: num  0 1 0 0 0 0 0 0 0 0 ...
 $ Plebejus_idas        : num  0 1 0 0 0 0 1 0 0 0 ...
 $ Polygonia_calbum     : num  1 0 0 0 0 0 0 0 1 0 ...
 $ Polyommatus_amandus  : num  0 0 0 0 0 0 0 0 0 0 ...
 $ Polyommatus_coridon  : num  0 0 0 0 0 1 0 0 0 0 ...
 $ Polyommatus_dorylas  : num  0 0 0 0 0 0 0 0 0 0 ...
 $ Polyommatus_icarus   : num  1 1 1 1 1 1 1 0 1 1 ...
 $ Polyommatus_thersites: num  0 0 0 0 0 1 0 0 0 0 ...
 $ Pyrgus_armoricanus   : num  0 0 0 0 0 0 0 0 0 0 ...
 $ Pyrgus_alveus        : num  0 0 0 0 0 0 0 0 0 0 ...
 $ Pyrgus_malvae        : num  0 0 1 0 0 0 1 0 0 1 ...
 $ Satyrium_acaciae     : num  0 0 0 0 0 0 0 0 0 0 ...
 $ Satyrium_ilicis      : num  0 0 0 0 0 0 0 0 0 0 ...
 $ Thymelicus_lineola   : num  0 1 1 1 1 0 1 1 1 0 ...
 $ Thymelicus_sylvestris: num  0 1 1 0 0 0 1 0 1 1 ...
 $ Vanessa_atalanta     : num  0 0 0 0 0 0 0 0 0 0 ...
 $ Vanessa_cardui       : num  0 0 0 0 0 0 0 0 0 0 ...
> str(envir)
'data.frame':	120 obs. of  13 variables:
 $ woody_1ha    : num  0.36 0.257 0.451 -1.245 -1.245 ...
 $ spot_1ha     : num  -0.159 -0.313 0.909 -0.313 1.265 ...
 $ TWI          : num  1.635 -0.636 -0.312 0.398 1.105 ...
 $ heatload     : num  0.789 -1.001 -1.257 0.363 0.704 ...
 $ sidi_50ha    : num  -1.879 0.621 -1.139 -1.292 0.341 ...
 $ woody_50ha   : num  -0.374 1.437 0.477 -1.838 -1.272 ...
 $ rugg_50ha    : num  -1.271 0.609 0.192 -0.695 -0.037 ...
 $ ed_50ha      : num  -1.125 0.704 -0.414 -0.516 0.399 ...
 $ woodypercatch: num  0.566 0.566 0.566 -1.076 -1.076 ...
 $ catch_rugged : num  0.236 0.236 0.236 2.084 2.084 ...
 $ Edfine       : num  0.926 0.926 0.926 0.453 0.453 ...
 $ SIDIfine     : num  0.719 0.719 0.719 -0.401 -0.401 ...
 $ pastpercatch : num  -1.111 -1.111 -1.111 0.703 0.703 ...
> str(butttraitX)
'data.frame':	88 obs. of  11 variables:
 $ Winglength : Factor w/ 25 levels "11","12","13",..: 13 10 20 22 11 19 7
16 14 15 ...
 $ Eggs_pot   : Factor w/ 52 levels "64","65","70",..: 51 33 20 22 28 33 37
32 30 25 ...
 $ Generations: Factor w/ 5 levels "2","3","4","5",..: 2 1 1 1 1 1 4 1 1 1
...
 $ Winterstage: Factor w/ 5 levels "adult","egg",..: 1 5 3 3 3 3 5 2 3 2 ...
 $ Eggdevtime : Factor w/ 32 levels "3","4","5","6",..: 6 3 10 12 14 14 3 27
15 30 ...
 $ Larvdevtime: Factor w/ 40 levels "16","17","18",..: 3 1 13 38 38 40 7 25
32 19 ...
 $ Pupdevtime : Factor w/ 23 levels "8","10","11",..: 2 23 8 7 10 8 4 12 9 6
...
 $ Imagotime  : Factor w/ 14 levels "10","12","14",..: 12 3 8 8 7 1 3 10 7 5
...
 $ r.K        : Factor w/ 2 levels "K","r": 2 1 1 1 1 2 2 1 1 1 ...
 $ Diet       : Factor w/ 3 levels "m","o","p": 1 2 2 1 3 2 1 1 1 1 ...
 $ Mobility   : Factor w/ 8 levels "1","2","3","4",..: 6 4 4 3 3 5 5 4 3 3
...

summary(pres.rlq)

Eigenvalues decomposition:
        eig     covar      sdR      sdQ      corr
1 0.6267516 0.7916764 1.724234 2.008068 0.2286511
2 0.2434880 0.4934451 1.153176 1.944874 0.2200148

Inertia & coinertia R:
    inertia      max     ratio
1  2.972982 3.249839 0.9148091
12 4.302797 5.171932 0.8319515

Inertia & coinertia Q:
    inertia       max     ratio
1  4.032335  7.669151 0.5257864
12 7.814868 13.948402 0.5602698

Correlation L:
       corr       max     ratio
1 0.2286511 0.4422966 0.5169633
2 0.2200148 0.4046466 0.5437207

I have been trying to find the mistake for hours already and I just can´t
get a clue why the test works for one example but not for the other. I would
be happy about recommendations how to solve this problem. 

Best wishes, 
Jacqueline




--
View this message in context: http://r.789695.n4.nabble.com/Using-randtest-in-rlq-works-for-one-dataset-but-not-for-the-other-tp4705655.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list