Dear List members, I would like to ask for advise on quantile regression in R. I am trying to perform an analysis of a relationship between species abundance and its habitat requirements - the habitat requirements are, however, codes - 0,1,2,3... where 0<1<2<3 and the scale is linear - so I would be happy to treat them as continuos The analysis of the data somehow does not work, I am trying to perform linear quantile regression using rq function and I cannot figure out whether there is a way to analyse the data using quantile regression ( I would really like to do this since the shape is an envelope) or whether it is not possible. I tested that if I replace the categories with continuous data of the same range it works perfectly. In the form I have them ( and I cannot change it) I am getting errors - mainly about non-positive fis. Could somebody please let me know whether there was a way to analyse the data? The data are enclosed and the question is Is there a relationship between abundance and absdeviation? I am interested in the upperlimit so I wanted to analyze the upper 5%. Thanks a lot for your help All the best Zuzana Munzbergova www.natur.cuni.cz/~zuzmun -------------- next part -------------- abundance absdeviation 1 0.051643192 0 2 0.056338028 1 3 0.075117371 0 4 0.131455399 0 5 0.075117371 1 6 0.009389671 1 7 0.028169014 1 8 0.009389671 1 9 0.098591549 1 10 0.093896714 0 11 0.037558685 1 12 0.028169014 2 13 0.0657277 0 14 0.028169014 0 15 0.037558685 2 16 0.0657277 0 17 0.075117371 0 18 0.03286385 3 19 0.065420561 0 20 0.08411215 1 21 0.037383178 0 22 0.08411215 0 23 0.028037383 0 24 0.070093458 1 25 0.065420561 1 26 0.018691589 1 27 0.056074766 1 28 0.102803738 0 29 0.037383178 1 30 0.018691589 0 31 0.018691589 0 32 0.08411215 2 33 0.028037383 0 34 0.037383178 0 35 0.121495327 0 36 0.042056075 3 37 0.048076923 0 38 0.105769231 1 39 0.115384615 0 40 0.096153846 0 41 0.072115385 1 42 0.009615385 1 43 0.052884615 1 44 0.009615385 1 45 0.048076923 1 46 0.038461538 0 47 0.096153846 0 48 0.009615385 1 49 0.019230769 0 50 0.009615385 0 51 0.028846154 0 52 0.086538462 0 53 0.076923077 0 54 0.076923077 3 55 0.052631579 0 56 0.078947368 1 57 0.065789474 0 58 0.078947368 0 59 0.046052632 1 60 0.039473684 1 61 0.039473684 1 62 0.078947368 1 63 0.026315789 0 64 0.138157895 0 65 0.032894737 0 66 0.026315789 0 67 0.092105263 0 68 0.026315789 0 69 0.131578947 1 70 0.046052632 3 71 0.03626943 0 72 0.056994819 1 73 0.046632124 0 74 0.103626943 0 75 0.077720207 1 76 0.020725389 1 77 0.025906736 1 78 0.186528497 1 79 0.020725389 0 80 0.103626943 0 81 0.010362694 1 82 0.025906736 0 83 0.051813472 0 84 0.015544041 0 85 0.025906736 0 86 0.077720207 0 87 0.03626943 0 88 0.03626943 1 89 0.020725389 3 90 0.020725389 1 91 0.093457944 0 92 0.074766355 1 93 0.102803738 0 94 0.018691589 0 95 0.093457944 1 96 0.028037383 1 97 0.028037383 1 98 0.009345794 1 99 0.070093458 1 100 0.018691589 0 101 0.242990654 0 102 0.018691589 1 103 0.009345794 1 104 0.023364486 0 105 0.046728972 0 106 0.018691589 0 107 0.042056075 0 108 0.018691589 0 109 0.042056075 3 110 0.122641509 0 111 0.056603774 1 112 0.056603774 0 113 0.099056604 0 114 0.018867925 0 115 0.122641509 1 116 0.009433962 1 117 0.04245283 1 118 0.028301887 0 119 0.150943396 0 120 0.018867925 1 121 0.037735849 0 122 0.047169811 0 123 0.028301887 0 124 0.08490566 0 125 0.009433962 0 126 0.066037736 1 127 0.12987013 0 128 0.060606061 1 129 0.112554113 0 130 0.138528139 1 131 0.043290043 1 132 0.034632035 1 133 0.025974026 1 134 0.017316017 1 135 0.017316017 0 136 0.12987013 0 137 0.034632035 0 138 0.025974026 0 139 0.043290043 0 140 0.025974026 0 141 0.025974026 0 142 0.060606061 0 143 0.056277056 1 144 0.008658009 1 145 0.141414141 0 146 0.065656566 1 147 0.01010101 0 148 0.070707071 0 149 0.080808081 1 150 0.025252525 1 151 0.050505051 1 152 0.01010101 0 153 0.04040404 0 154 0.04040404 1 155 0.01010101 0 156 0.02020202 0 157 0.01010101 2 158 0.080808081 0 159 0.01010101 0 160 0.02020202 0 161 0.01010101 0 162 0.141414141 0 163 0.04040404 1 164 0.121212121 3 165 0.152173913 0 166 0.043478261 1 167 0.054347826 0 168 0.065217391 0 169 0.010869565 0 170 0.130434783 1 171 0.032608696 0 172 0.043478261 1 173 0.02173913 1 174 0.010869565 0 175 0.097826087 0 176 0.010869565 1 177 0.048913043 0 178 0.010869565 0 179 0.02173913 0 180 0.065217391 0 181 0.065217391 0 182 0.070652174 1 183 0.010869565 1 184 0.085365854 0 185 0.073170732 1 186 0.048780488 0 187 0.170731707 1 188 0.036585366 1 189 0.073170732 1 190 0.134146341 0 191 0.024390244 1 192 0.036585366 0 193 0.109756098 0 194 0.036585366 0 195 0.158536585 1 196 0.012195122 3 197 0.077669903 0 198 0.087378641 1 199 0.077669903 0 200 0.029126214 0 201 0.009708738 0 202 0.13592233 1 203 0.009708738 1 204 0.116504854 1 205 0.009708738 0 206 0.174757282 0 207 0.009708738 1 208 0.029126214 0 209 0.029126214 0 210 0.087378641 0 211 0.077669903 1 212 0.038834951 3 213 0.133333333 0 214 0.108333333 1 215 0.05 0 216 0.041666667 0 217 0.058333333 0 218 0.125 1 219 0.041666667 1 220 0.216666667 1 221 0.016666667 1 222 0.041666667 0 223 0.05 0 224 0.116666667 0 225 0.179487179 0 226 0.307692308 1 227 0.038461538 0 228 0.096153846 0 229 0.044871795 1 230 0.038461538 1 231 0.012820513 1 232 0.038461538 0 233 0.076923077 0 234 0.051282051 0 235 0.115384615 0 236 0.174863388 0 237 0.262295082 1 238 0.06557377 0 239 0.06557377 0 240 0.010928962 0 241 0.010928962 1 242 0.010928962 1 243 0.076502732 1 244 0.010928962 0 245 0.032786885 0 246 0.06557377 0 247 0.049180328 0 248 0.163934426 0 249 0.134453782 0 250 0.201680672 1 251 0.058823529 0 252 0.033613445 0 253 0.016806723 0 254 0.042016807 1 255 0.033613445 1 256 0.084033613 0 257 0.016806723 1 258 0.016806723 1 259 0.016806723 0 260 0.050420168 0 261 0.033613445 0 262 0.092436975 0 263 0.12605042 0 264 0.042016807 1 265 0.071005917 0 266 0.284023669 1 267 0.071005917 0 268 0.023668639 0 269 0.082840237 0 270 0.059171598 1 271 0.082840237 1 272 0.01183432 1 273 0.023668639 0 274 0.01183432 0 275 0.041420118 0 276 0.177514793 0 277 0.059171598 1 278 0.093617021 0 279 0.153191489 1 280 0.034042553 0 281 0.05106383 0 282 0.093617021 1 283 0.042553191 0 284 0.008510638 1 285 0.085106383 1 286 0.127659574 0 287 0.025531915 1 288 0.042553191 0 289 0.063829787 0 290 0.034042553 0 291 0.068085106 0 292 0.076595745 1 293 0.125490196 0 294 0.125490196 1 295 0.047058824 0 296 0.082352941 0 297 0.109803922 1 298 0.015686275 1 299 0.109803922 1 300 0.007843137 1 301 0.023529412 0 302 0.047058824 0 303 0.08627451 0 304 0.078431373 0 305 0.117647059 0 306 0.023529412 0 307 0.051948052 0 308 0.103896104 1 309 0.181818182 0 310 0.087662338 0 311 0.103896104 1 312 0.006493506 1 313 0.016233766 1 314 0.077922078 1 315 0.019480519 1 316 0.032467532 0 317 0.019480519 0 318 0.019480519 2 319 0.045454545 0 320 0.019480519 0 321 0.090909091 0 322 0.012987013 0 323 0.090909091 0 324 0.019480519 0 325 0.122137405 0 326 0.122137405 1 327 0.267175573 0 328 0.022900763 1 329 0.007633588 1 330 0.030534351 1 331 0.015267176 1 332 0.030534351 0 333 0.015267176 2 334 0.038167939 0 335 0.06870229 0 336 0.038167939 0 337 0.022900763 0 338 0.106870229 0 339 0.045801527 0 340 0.045801527 0 341 0.119850187 0 342 0.119850187 1 343 0.205992509 0 344 0.02247191 0 345 0.097378277 1 346 0.007490637 1 347 0.007490637 1 348 0.007490637 1 349 0.074906367 1 350 0.014981273 0 351 0.007490637 2 352 0.007490637 1 353 0.02247191 0 354 0.037453184 0 355 0.014981273 0 356 0.02247191 0 357 0.097378277 0 358 0.104868914 0 359 0.007490637 0 360 0.174545455 0 361 0.116363636 1 362 0.043636364 0 363 0.029090909 0 364 0.072727273 0 365 0.014545455 1 366 0.007272727 1 367 0.04 1 368 0.007272727 1 369 0.007272727 0 370 0.007272727 0 371 0.007272727 0 372 0.058181818 0 373 0.036363636 0 374 0.021818182 0 375 0.254545455 0 376 0.050909091 0 377 0.050909091 0 378 0.12 0 379 0.16 1 380 0.1 0 381 0.15 1 382 0.02 1 383 0.06 1 384 0.03 0 385 0.01 0 386 0.09 0 387 0.06 0 388 0.16 0 389 0.04 0 390 0.157068063 0 391 0.083769634 1 392 0.146596859 0 393 0.020942408 0 394 0.052356021 1 395 0.020942408 2 396 0.031413613 0 397 0.062827225 1 398 0.172774869 1 399 0.094240838 0 400 0.015706806 0 401 0.031413613 0 402 0.020942408 0 403 0.047120419 0 404 0.031413613 0 405 0.010471204 3 406 0.210526316 0 407 0.092105263 1 408 0.013157895 0 409 0.197368421 0 410 0.131578947 1 411 0.026315789 1 412 0.197368421 1 413 0.013157895 1 414 0.026315789 0 415 0.039473684 0 416 0.013157895 0 417 0.039473684 0 418 0.166666667 0 419 0.05 1 420 0.266666667 0 421 0.1 1 422 0.016666667 1 423 0.033333333 0 424 0.25 1 425 0.016666667 1 426 0.05 0 427 0.05 0 428 0.180451128 0 429 0.07518797 1 430 0.030075188 0 431 0.22556391 0 432 0.030075188 0 433 0.015037594 1 434 0.090225564 0 435 0.090225564 1 436 0.120300752 0 437 0.015037594 0 438 0.030075188 0 439 0.045112782 0 440 0.022556391 0 441 0.015037594 0 442 0.015037594 0 443 0.12 0 444 0.04 1 445 0.144 0 446 0.088 1 447 0.056 1 448 0.024 1 449 0.024 1 450 0.312 1 451 0.016 0 452 0.024 0 453 0.016 0 454 0.032 0 455 0.016 0 456 0.088 0 457 0.239130435 0 458 0.239130435 1 459 0.086956522 0 460 0.173913043 0 461 0.065217391 1 462 0.02173913 1 463 0.02173913 1 464 0.02173913 0 465 0.086956522 0 466 0.02173913 0 467 0.02173913 0 468 0.088235294 0 469 0.102941176 1 470 0.176470588 0 471 0.036764706 0 472 0.044117647 0 473 0.117647059 1 474 0.022058824 0 475 0.022058824 0 476 0.088235294 1 477 0.029411765 1 478 0.022058824 1 479 0.029411765 0 480 0.014705882 1 481 0.014705882 0 482 0.014705882 0 483 0.036764706 0 484 0.029411765 0 485 0.029411765 0 486 0.014705882 0 487 0.007352941 2 488 0.058823529 0 489 0.113475177 0 490 0.113475177 1 491 0.156028369 0 492 0.035460993 0 493 0.042553191 0 494 0.113475177 1 495 0.007092199 0 496 0.056737589 1 497 0.014184397 1 498 0.021276596 0 499 0.127659574 1 500 0.007092199 0 501 0.042553191 0 502 0.021276596 0 503 0.014184397 0 504 0.028368794 2 505 0.085106383 0 506 0.142857143 0 507 0.116071429 1 508 0.107142857 0 509 0.089285714 0 510 0.285714286 1 511 0.017857143 1 512 0.044642857 0 513 0.0625 1 514 0.017857143 1 515 0.017857143 0 516 0.053571429 0 517 0.044642857 0 518 0.121212121 0 519 0.121212121 1 520 0.166666667 0 521 0.037878788 0 522 0.049242424 0 523 0.121212121 1 524 0.018939394 1 525 0.007575758 0 526 0.015151515 1 527 0.181818182 1 528 0.007575758 1 529 0.007575758 1 530 0.053030303 0 531 0.007575758 0 532 0.007575758 2 533 0.068181818 0 534 0.007575758 3 535 0.139130435 0 536 0.113043478 1 537 0.182608696 0 538 0.143478261 0 539 0.139130435 1 540 0.008695652 0 541 0.026086957 1 542 0.017391304 1 543 0.008695652 1 544 0.043478261 1 545 0.008695652 0 546 0.039130435 0 547 0.008695652 0 548 0.008695652 0 549 0.086956522 0 550 0.026086957 0 551 0.091428571 0 552 0.074285714 1 553 0.057142857 0 554 0.011428571 0 555 0.148571429 0 556 0.057142857 0 557 0.182857143 1 558 0.011428571 0 559 0.034285714 1 560 0.017142857 0 561 0.16 1 562 0.011428571 0 563 0.011428571 1 564 0.011428571 0 565 0.04 0 566 0.011428571 2 567 0.057142857 0 568 0.011428571 3 569 0.129032258 0 570 0.172043011 1 571 0.094086022 0 572 0.080645161 1 573 0.161290323 1 574 0.053763441 1 575 0.053763441 0 576 0.005376344 0 577 0.032258065 0 578 0.053763441 0 579 0.107526882 0 580 0.056451613 0 581 0.164383562 0 582 0.383561644 1 583 0.006849315 0 584 0.006849315 1 585 0.219178082 1 586 0.006849315 1 587 0.006849315 0 588 0.068493151 0 589 0.136986301 3 590 0.113744076 0 591 0.151658768 1 592 0.071090047 0 593 0.063981043 1 594 0.037914692 0 595 0.151658768 1 596 0.037914692 1 597 0.047393365 0 598 0.049763033 0 599 0.023696682 1 600 0.052132701 0 601 0.014218009 0 602 0.113744076 0 603 0.071090047 3 604 0.157894737 0 605 0.210526316 1 606 0.065789474 0 607 0.217105263 1 608 0.059210526 1 609 0.065789474 0 610 0.039473684 1 611 0.026315789 0 612 0.157894737 0 613 0.124481328 0 614 0.531120332 1 615 0.024896266 0 616 0.012448133 1 617 0.024896266 1 618 0.041493776 2 619 0.008298755 0 620 0.008298755 0 621 0.066390041 1 622 0.008298755 0 623 0.149377593 0 624 0.144444444 0 625 0.355555556 1 626 0.288888889 0 627 0.011111111 0 628 0.066666667 1 629 0.011111111 1 630 0.055555556 2 631 0.033333333 0 632 0.033333333 0 633 0.212389381 0 634 0.212389381 1 635 0.17699115 0 636 0.008849558 0 637 0.212389381 1 638 0.044247788 1 639 0.008849558 1 640 0.026548673 1 641 0.008849558 1 642 0.044247788 1 643 0.017699115 0 644 0.008849558 0 645 0.017699115 3 646 0.337236534 0 647 0.149882904 1 648 0.009367681 0 649 0.018735363 0 650 0.112412178 0 651 0.105386417 1 652 0.004683841 0 653 0.037470726 1 654 0.004683841 1 655 0.009367681 0 656 0.018735363 0 657 0.105386417 0 658 0.077283372 0 659 0.009367681 3 660 0.235294118 0 661 0.033613445 1 662 0.042016807 0 663 0.100840336 0 664 0.004201681 0 665 0.235294118 1 666 0.025210084 0 667 0.037815126 0 668 0.092436975 1 669 0.033613445 1 670 0.004201681 0 671 0.109243697 0 672 0.012605042 0 673 0.033613445 0 674 0.228571429 0 675 0.185714286 0 676 0.130612245 0 677 0.004081633 0 678 0.163265306 1 679 0.010204082 1 680 0.012244898 1 681 0.004081633 1 682 0.008163265 0 683 0.097959184 1 684 0.004081633 0 685 0.085714286 0 686 0.040816327 0 687 0.024489796 3 688 0.160535117 0 689 0.040133779 1 690 0.160535117 0 691 0.026755853 0 692 0.267558528 1 693 0.026755853 1 694 0.026755853 2 695 0.053511706 1 696 0.033444816 0 697 0.02006689 1 698 0.090301003 1 699 0.060200669 0 700 0.02006689 0 701 0.013377926 3 702 0.198757764 0 703 0.00621118 1 704 0.01863354 0 705 0.149068323 0 706 0.01863354 0 707 0.248447205 1 708 0.01863354 1 709 0.049689441 1 710 0.00621118 1 711 0.00621118 0 712 0.198757764 1 713 0.01863354 1 714 0.049689441 0 715 0.01242236 0 716 0.073529412 0 717 0.191176471 1 718 0.147058824 0 719 0.334558824 1 720 0.073529412 1 721 0.007352941 0 722 0.018382353 0 723 0.154411765 0 724 0.152249135 0 725 0.276816609 1 726 0.07266436 1 727 0.006920415 1 728 0.020761246 1 729 0.027681661 0 730 0.442906574 0 731 0.368421053 0 732 0.230263158 1 733 0.019736842 1 734 0.006578947 1 735 0.059210526 1 736 0.006578947 0 737 0.009868421 0 738 0.299342105 0 739 0.412903226 0 740 0.309677419 1 741 0.038709677 1 742 0.032258065 1 743 0.012903226 0 744 0.193548387 0 745 0.243654822 0 746 0.243654822 1 747 0.060913706 1 748 0.152284264 1 749 0.060913706 1 750 0.040609137 0 751 0.197969543 0 752 0.173553719 0 753 0.330578512 1 754 0.008264463 0 755 0.041322314 1 756 0.082644628 1 757 0.066115702 1 758 0.008264463 0 759 0.289256198 0 760 0.336134454 0 761 0.268907563 1 762 0.025210084 0 763 0.008403361 1 764 0.067226891 1 765 0.008403361 1 766 0.025210084 0 767 0.25210084 0 768 0.008403361 0 769 0.533333333 0 770 0.228571429 1 771 0.038095238 0 772 0.066666667 1 773 0.038095238 1 774 0.057142857 0 775 0.038095238 0 776 0.421052632 0 777 0.210526316 1 778 0.013157895 1 779 0.105263158 1 780 0.026315789 1 781 0.039473684 0 782 0.013157895 0 783 0.026315789 0 784 0.144736842 0 785 0.396039604 0 786 0.03960396 0 787 0.03960396 1 788 0.158415842 1 789 0.059405941 1 790 0.108910891 0 791 0.02970297 0 792 0.03960396 0 793 0.128712871 0 794 0.158102767 0 795 0.166007905 1 796 0.4743083 0 797 0.051383399 1 798 0.039525692 1 799 0.055335968 0 800 0.055335968 0 801 0.326530612 0 802 0.326530612 1 803 0.132653061 1 804 0.040816327 1 805 0.051020408 1 806 0.020408163 0 807 0.102040816 0 808 0.125 0 809 0.115384615 1 810 0.019230769 0 811 0.096153846 0 812 0.019230769 1 813 0.038461538 1 814 0.153846154 1 815 0.057692308 1 816 0.096153846 0 817 0.019230769 0 818 0.259615385 0 819 0.081081081 0 820 0.108108108 1 821 0.013513514 0 822 0.013513514 0 823 0.013513514 1 824 0.108108108 1 825 0.540540541 1 826 0.013513514 0 827 0.094594595 0 828 0.013513514 3 829 0.262295082 1 830 0.098360656 0 831 0.016393443 1 832 0.262295082 1 833 0.098360656 1 834 0.016393443 0 835 0.016393443 0 836 0.024590164 1 837 0.204918033 0 838 0.083333333 0 839 0.12037037 1 840 0.009259259 0 841 0.074074074 0 842 0.027777778 1 843 0.481481481 1 844 0.046296296 1 845 0.027777778 1 846 0.018518519 0 847 0.018518519 0 848 0.009259259 1 849 0.083333333 0 850 0.201438849 0 851 0.460431655 1 852 0.057553957 0 853 0.115107914 1 854 0.014388489 1 855 0.021582734 0 856 0.014388489 1 857 0.115107914 0 858 0.123222749 0 859 0.123222749 1 860 0.009478673 0 861 0.573459716 1 862 0.047393365 1 863 0.047393365 1 864 0.075829384 0 865 0.179775281 0 866 0.292134831 1 867 0.179775281 0 868 0.011235955 1 869 0.033707865 1 870 0.011235955 1 871 0.292134831 0 872 0.205128205 0 873 0.222222222 1 874 0.085470085 0 875 0.034188034 1 876 0.034188034 1 877 0.008547009 1 878 0.025641026 1 879 0.025641026 0 880 0.025641026 0 881 0.299145299 0 882 0.034188034 0 883 0.186046512 0 884 0.186046512 1 885 0.186046512 0 886 0.069767442 1 887 0.081395349 1 888 0.034883721 1 889 0.023255814 1 890 0.011627907 0 891 0.058139535 0 892 0.162790698 0 893 0.157068063 0 894 0.12565445 1 895 0.235602094 0 896 0.020942408 1 897 0.12565445 0 898 0.167539267 1 899 0.031413613 1 900 0.010471204 1 901 0.010471204 1 902 0.010471204 0 903 0.104712042 0 904 0.229665072 0 905 0.157894737 1 906 0.28708134 0 907 0.009569378 1 908 0.019138756 1 909 0.009569378 0 910 0.28708134 0 911 0.172413793 0 912 0.183908046 1 913 0.367816092 0 914 0.034482759 1 915 0.011494253 1 916 0.022988506 1 917 0.206896552 0 918 0.018018018 1 919 0.036036036 0 920 0.009009009 1 921 0.072072072 1 922 0.864864865 0 923 0.024390244 1 924 0.048780488 0 925 0.032520325 1 926 0.016260163 1 927 0.016260163 0 928 0.780487805 0 929 0.016260163 0 930 0.06504065 2 931 0.008928571 0 932 0.116071429 1 933 0.857142857 0 934 0.017857143 0 935 0.018867925 1 936 0.018867925 0 937 0.056603774 0 938 0.905660377 0 939 0.03968254 1 940 0.071428571 0 941 0.047619048 1 942 0.015873016 0 943 0.031746032 0 944 0.761904762 0 945 0.031746032 0 946 0.028846154 1 947 0.048076923 0 948 0.038461538 1 949 0.019230769 0 950 0.865384615 0 951 0.109375 1 952 0.03125 0 953 0.0703125 1 954 0.0234375 0 955 0.03125 1 956 0.0625 1 957 0.015625 0 958 0.015625 0 959 0.015625 0 960 0.09375 1 961 0.5 0 962 0.03125 1 963 0.052083333 1 964 0.083333333 0 965 0.0625 1 966 0.083333333 0 967 0.145833333 1 968 0.229166667 1 969 0.020833333 0 970 0.020833333 0 971 0.28125 0 972 0.020833333 2 973 0.044444444 0 974 0.088888889 1 975 0.074074074 0 976 0.074074074 0 977 0.037037037 1 978 0.02962963 0 979 0.103703704 1 980 0.148148148 1 981 0.148148148 1 982 0.02962963 0 983 0.148148148 0 984 0.02962963 2 985 0.02962963 0 986 0.014814815 0 987 0.018867925 0 988 0.075471698 1 989 0.132075472 0 990 0.037735849 1 991 0.018867925 0 992 0.075471698 1 993 0.075471698 1 994 0.150943396 1 995 0.018867925 0 996 0.396226415 0 997 0.088495575 1 998 0.088495575 0 999 0.079646018 1 1000 0.017699115 0 1001 0.017699115 0 1002 0.283185841 1 1003 0.17699115 1 1004 0.088495575 0 1005 0.03539823 2 1006 0.07079646 1 1007 0.053097345 1 1008 0.108108108 0.5 1009 0.054054054 0.5 1010 0.018018018 1.5 1011 0.036036036 0.5 1012 0.243243243 0.5 1013 0.018018018 0.5 1014 0.09009009 0.5 1015 0.018018018 0.5 1016 0.288288288 0.5 1017 0.054054054 1.5 1018 0.018018018 1.5 1019 0.054054054 0.5 1020 0.046979866 0 1021 0.073825503 1 1022 0.060402685 0 1023 0.100671141 1 1024 0.013422819 1 1025 0.067114094 0 1026 0.013422819 1 1027 0.013422819 0 1028 0.590604027 0 1029 0.020134228 1 1030 0.026785714 0 1031 0.080357143 1 1032 0.089285714 0 1033 0.0625 1 1034 0.017857143 0 1035 0.714285714 0 1036 0.008928571 1 1037 0.030120482 0 1038 0.060240964 1 1039 0.120481928 0 1040 0.030120482 1 1041 0.024096386 0 1042 0.036144578 1 1043 0.012048193 0 1044 0.012048193 0 1045 0.674698795 0 1046 0.113924051 0 1047 0.056962025 1 1048 0.050632911 0 1049 0.063291139 1 1050 0.348101266 1 1051 0.303797468 0 1052 0.012658228 1 1053 0.037974684 0 1054 0.012658228 1 1055 0.153846154 0 1056 0.097902098 1 1057 0.181818182 0 1058 0.055944056 1 1059 0.013986014 1 1060 0.06993007 0 1061 0.384615385 0 1062 0.027972028 1 1063 0.013986014 1 1064 0.051282051 0 1065 0.068376068 1 1066 0.068376068 0 1067 0.076923077 1 1068 0.025641026 0 1069 0.017094017 0 1070 0.017094017 1 1071 0.017094017 0 1072 0.512820513 0 1073 0.025641026 1 1074 0.051282051 0 1075 0.017094017 3 1076 0.051282051 1 1077 0.074074074 0 1078 0.061728395 1 1079 0.049382716 0 1080 0.024691358 1 1081 0.172839506 1 1082 0.024691358 0 1083 0.592592593 0 1084 0.1625 1 1085 0.025 0 1086 0.05 0 1087 0.0625 1 1088 0.45 1 1089 0.25 0 1090 0.09009009 1 1091 0.099099099 0 1092 0.27027027 0 1093 0.072072072 1 1094 0.162162162 1 1095 0.18018018 0 1096 0.018018018 1 1097 0.09009009 1 1098 0.018018018 1 1099 0.170731707 1 1100 0.024390244 0 1101 0.048780488 1 1102 0.146341463 1 1103 0.609756098 0 1104 0.016 0 1105 0.072 1 1106 0.04 0 1107 0.048 1 1108 0.128 1 1109 0.016 0 1110 0.016 1 1111 0.32 0 1112 0.048 1 1113 0.256 1 1114 0.04 1 1115 0.239316239 1 1116 0.025641026 0 1117 0.085470085 0 1118 0.102564103 1 1119 0.273504274 1 1120 0.256410256 0 1121 0.017094017 1 1122 0.033149171 1 1123 0.099447514 0 1124 0.011049724 0 1125 0.011049724 1 1126 0.35359116 1 1127 0.044198895 0 1128 0.447513812 0 1129 0.012121212 0.5 1130 0.072727273 0.5 1131 0.127272727 0.5 1132 0.024242424 0.5 1133 0.678787879 0.5 1134 0.084848485 0.5 1135 0.117647059 1 1136 0.051470588 0 1137 0.014705882 0 1138 0.176470588 1 1139 0.014705882 0 1140 0.588235294 0 1141 0.036764706 1 1142 0.14 1 1143 0.12 0 1144 0.02 1 1145 0.06 1 1146 0.02 0 1147 0.64 0 1148 0.046153846 1 1149 0.061538462 0 1150 0.015384615 0 1151 0.253846154 1 1152 0.030769231 0 1153 0.430769231 0 1154 0.161538462 1 1155 0.113636364 0 1156 0.181818182 0 1157 0.363636364 1 1158 0.340909091 0 1159 0.009090909 1 1160 0.009090909 0 1161 0.054545455 1 1162 0.009090909 0 1163 0.509090909 0 1164 0.027272727 1 1165 0.109090909 1 1166 0.272727273 0 1167 0.018518519 0 1168 0.092592593 1 1169 0.046296296 0 1170 0.018518519 1 1171 0.055555556 0 1172 0.055555556 1 1173 0.018518519 1 1174 0.055555556 0 1175 0.388888889 0 1176 0.101851852 1 1177 0.092592593 1 1178 0.055555556 0 1179 0.019230769 0 1180 0.096153846 1 1181 0.115384615 0 1182 0.038461538 0 1183 0.019230769 1 1184 0.038461538 0 1185 0.307692308 0 1186 0.038461538 1 1187 0.230769231 1 1188 0.096153846 0 1189 0.023809524 0 1190 0.047619048 1 1191 0.047619048 0 1192 0.053571429 0 1193 0.095238095 0 1194 0.011904762 1 1195 0.160714286 1 1196 0.011904762 1 1197 0.011904762 0 1198 0.25 0 1199 0.035714286 1 1200 0.071428571 1 1201 0.178571429 0 1202 0.013793103 1 1203 0.179310345 0 1204 0.013793103 1 1205 0.034482759 0 1206 0.027586207 1 1207 0.165517241 1 1208 0.020689655 0 1209 0.137931034 0 1210 0.144827586 1 1211 0.186206897 1 1212 0.075862069 0 1213 0.016260163 0 1214 0.016260163 1 1215 0.113821138 0 1216 0.016260163 0 1217 0.032520325 1 1218 0.032520325 1 1219 0.040650407 0 1220 0.260162602 0 1221 0.162601626 1 1222 0.06504065 1 1223 0.243902439 0
Since almost all (95%) of the observations are concentrated at x=0 and x=1, any fitting you do is strongly influenced by what would be obtained by simply fitting quantiles at these two points and interpolating, and extrapolating according to your favored model. I did the following: require(quantreg) formula <- log(y) ~ x plot(x,y) z <- 1:30/10 for(tau in 10:19/20){ f <- rq(formula,tau = tau) lines(z,exp(cbind(1,z) %*% f$coef)) } url: www.econ.uiuc.edu/~roger Roger Koenker email rkoenker at uiuc.edu Department of Economics vox: 217-333-4558 University of Illinois fax: 217-244-6678 Champaign, IL 61820 On Dec 10, 2005, at 11:30 AM, zuzmun at natur.cuni.cz wrote:> Dear List members, > > I would like to ask for advise on quantile regression in R. > > I am trying to perform an analysis of a relationship between > species abundance and its habitat requirements - > the habitat requirements are, however, codes - 0,1,2,3... where > 0<1<2<3 and the scale is linear - so I would be happy to treat them > as continuos > > The analysis of the data somehow does not work, I am trying to > perform linear quantile regression using rq function and I cannot > figure out whether there is a way to analyse the data using > quantile regression ( I would really like to do this since the > shape is an envelope) or whether it is not possible. > > I tested that if I replace the categories with continuous data of > the same range it works perfectly. In the form I have them ( and I > cannot change it) I am getting > errors - mainly about non-positive fis. > > Could somebody please let me know whether there was a way to > analyse the data? > The data are enclosed and the question is > Is there a relationship between abundance and absdeviation? > I am interested in the upperlimit so I wanted to analyze the upper 5%. > > Thanks a lot for your help > > All the best > > Zuzana Munzbergova > > www.natur.cuni.cz/~zuzmun > <GSS1a.txt> > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting- > guide.html
On 10-Dec-05 zuzmun at natur.cuni.cz wrote:> Dear List members, > > I would like to ask for advise on quantile regression in R. > > I am trying to perform an analysis of a relationship between > species abundance and its habitat requirements - > the habitat requirements are, however, codes - 0,1,2,3... where 0<1<2<3 > and the scale is linear - so I would be happy to treat them as > continuosAs well as Roger Koenker's comments, you may also wish to consider the following. (By the way, despite what you say above, you have "codes" at values 0, 0.5, 1, 1.5, 2. 3 -- is there anything special about the 0.5 and 1.5, or are they on the same footing as 0, 1, 2, 3? Also, I am curious as to why "habitat requirement" is named "absdeviation" in the data file. What does "habitat requirement" mean?).> The analysis of the data somehow does not work, I am trying to > perform linear quantile regression using rq function and I cannot > figure out whether there is a way to analyse the data using quantile > regression (I would really like to do this since the shape is an > envelope) or whether it is not possible.As Roger noted, the distribution of data is very variable over the values of "absdeviation": absdeviation: 0 0.5 1 1.5 2 3 Number of data: 673 15 493 3 19 20 Total data: 1223 Therefore you chiefly have information about the cases "0" and "1". I have loked at the data the opposite way round from you: For each value of "absdeviation" ("H" for "habitat in the following), consider the values of "abundance" (A). For H=0 and H=1, the values of A are quite well approximated by a negative exponential distribution, thought the fit is better for H=1 than for H=0 -- in a more careful examination, I would try to emulate a for the continuous variable A a distribution inspired by the logarithmic distribution p(n) = (t^n)/(n*log(1-t)), n=0,1,2... which is a classic distribution for the probability that a species will be represented by n individuals in a sample of a large number of species whose different abundances are variable (Fisher, Corbett and Williams, and much later work). The mean A for H=0 is m0 = 0.09389265 (n0=673), and the mean A for H=1 is m1 = 0.08407791 (n1=493). with respective atandard deviations s0 = 0.1262238 s1 = 0.08952975 on the basis of which (m0-m1)/(sqrt((s0^2)/n0 + (s1^2)/n1)) = 1.553156 which is not particularly large. While the histograms hist(A[H==0],breaks=0.02*(0:50),freq=FALSE) and hist(A[H==1],breaks=0.02*(0:50),freq=FALSE) do somewhat indicate a tendency for higher values of A to occur when H=0 than when H=1 there are only a few of these. So on a first look, I am induced to conclude that there is little evidence in the two dominant data groups (H=0 and H=1) to indicate that these two groups differ. I doubt that the information for the H=0.5, H=1.5, H=2 anf H=3 would have more than a slight effect on this (though I have not looked on detail). The corresponding means, however, are m0.5 = 0.1273273 (n = 15) m1.5 = 0.03003003 (n = 3) m2 = 0.02908183 (n = 19) m3 = 0.03830066 (n = 20) which at first sight does suggest that, while m0.5 is similar to m0 and m1 above, m1.5 and m2 and m3 are distinctly smaller. However, for m1.5 this is based on a very small sample, and in any case the distribution of the raw values of A is so skew that the larger values of A occurring for H=0 and H=1 are unlikely to occur in such small samples. Therefore, preliminary conclusion: I cannot see strong evidence of a relationship between "absdeviation" and abundance. Hoping this is useful, Best wishes, Ted.> I tested that if I replace the categories with continuous > data of the same range it works perfectly. In the form I have > them (and I cannot change it) I am getting errors - mainly > about non-positive fis. > > Could somebody please let me know whether there was a way to > analyse the data? > The data are enclosed and the question is > Is there a relationship between abundance and absdeviation? > I am interested in the upperlimit so I wanted to analyze the upper 5%. > > Thanks a lot for your help > > All the best > > Zuzana Munzbergova > > www.natur.cuni.cz/~zuzmun-------------------------------------------------------------------- E-Mail: (Ted Harding) <Ted.Harding at nessie.mcc.ac.uk> Fax-to-email: +44 (0)870 094 0861 Date: 10-Dec-05 Time: 23:10:15 ------------------------------ XFMail ------------------------------