Docstoc

docx

Document Sample
docx Powered By Docstoc
					An Introduction to Popbio in R
BIOL 7901 – R for Ecologists, Fall 2009
Metha Klock (mklock1@lsu.edu)
12/4/09

       The Popbio package was developed by Chris Stubben (Los Alamos National Lab) and
Brook Milligan (New Mexico State University) to construct and analyze projection matrix
models. This package can also be used to construct matrix models using census data and to
estimate vital rates.

      In the notes below, I have used the Popbio package to analyze demographic data for
Chinese privet (Ligustrum sinense) that I collected during my masters thesis project.


References:

Crawley, M. J. 2005. The R Book. John Wiley & Sons, U.K.

Stubben, C, and B. Milligan. 2007. Estimating and analyzing demographic models using the
popbio package in R. Journal of Statistical Software 22:1-23.



Analyzing Projection Matrix Models using Popbio:

>install.packages(“popbio”)               Type this in the R console to install the package “Popbio”
                                          You will have to select a CRAN mirror for use in session
                                          Choose “CA1”

>stages                                   Sets stages for analysis
> stages <- c(“seedling”, “juvenile”, “smadult”, “medadult”, “lrgadult”)


>A <- matrix(c(0,0,28.294,77.315,1131.596,0.165,0.549,0,0,       Matrix data are entered columnwise
+0,0,0.048,0.815,0,0,0,0,0.142,0.787,0,0,0,0,0.181,0.892),
+ nrow=5, byrow=TRUE, dimnames = list(stages,stages))

>A
         seedling         juvenile smadult medadult lrgadult
seedling 0.000             0.000    28.294 77.315    1131.596
juvenile   0.165            0.549   0.000   0.000    0.000
smadult    0.000            0.048    0.815  0.000     0.000
medadult 0.000              0.000   0.142   0.787    0.000
lrgadult   0.000            0.000    0.000  0.181    0.892


>n <- c (5, 5, 5, 5, 5)                   Repeat projections over 25 intervals
>p<-pop.projection (A, n, 25)      The function “pop.projection” allows you to project growth
                                   of a population over time. It will give you the population
                                   growth rate (lambda), stable stage distributions, stage
                                   vectors, population sizes, and population changes

>p

$lambda
[1] 1.479522

$stable.stage
  seedling      juvenile     smadult    medadult      lrgadult
0.8378321590 0.1485650340 0.0107274427 0.0021982695 0.0006770949

$stage.vectors
            0     1          2           3          4           5
Seedling    5 6186.025 6552.229325 6801.084635 8327.488606 10881.086860
Juvenile    5 3.570 1022.654055 1642.554915 2023.941613 2485.179566
smadult     5 4.315 3.688085       52.093184 121.298581 196.007541
medadult 5 4.645 4.268345          3.882896     10.453071   25.450965
lrgadult    5 5.365 5.626325       5.791252     5.868601    7.126798
                 6             7              8         9          10
seedling 15578.23497 24002.04744 37571.32928 57899.61339 87325.47599
juvenile 3159.74291 4305.10763 6323.84192 9671.05854 14862.84735
smadult 279.03476 379.08099 515.59618 723.75530 1054.07138
medadult 47.86298       77.29110    114.65760 163.45019      231.40855
lrgadult   10.96373     18.44285    30.44071     47.90614    72.31676
                11          12            13         14          15         16
seedling    129548.6011 190536.9356 279712.0513 411456.7324 607159.456 898191.2734
juvenile    22568.4067 33765.5745 49975.8948 73589.2547 108290.862 159632.9933
smadult     1572.4848 2364.8587 3548.1074         5290.5505 7844.083 11590.8889
medadult 331.7967 484.4168            717.0460    1068.1464 1591.889 2366.6767
lrgadult    106.3915 154.9564        225.9006     331.2886    488.844    724.1808
                17           18            19         20         21         22
seedling    1330412.307 1971055.358 2919160.004 4321194.910 6394216.507 9460018.02
juvenile    235840.073 348994.231 516821.967 765396.661 1133199.927 1677172.48
smadult     17108.958 25264.124 37341.984 55241.172 81760.595 121028.48
medadult 3508.481       5190.646     7672.544     11340.854 16769.499 24807.60
lrgadult    1074.338    1593.344     2360.770     3494.537    5169.822  7646.76
                23          24
seedling 13995423.07 20706442.00
juvenile 2481670.67 3671682.00
smadult 179142.49 265121.32
medadult 36709.63 54328.71
lrgadult   11311.09 16733.93
$pop.sizes
 [1]   25.000 6203.920 7588.466 8505.407 10489.050
 [6] 13594.852 19075.839 28781.970 44555.866 68505.784
[11] 103546.120 154127.681 227306.742 334179.000 491735.973
[16] 725375.134 1072506.013 1587944.157 2352097.704 3483357.270
[21] 5156668.134 7631116.349 11290673.348 16704256.944 24714307.966

$pop.changes
 [1] 248.156800 1.223173 1.120833 1.233221 1.296099 1.403166
 [7] 1.508818 1.548048 1.537526 1.511495 1.488493 1.474795
[13] 1.470168 1.471475 1.475131 1.478554 1.480592 1.481222
[19] 1.480958 1.480373 1.479854 1.479557 1.479474 1.479522

>stage.vector.plot(p$stage.vectors, col = 2:4)           plot resulting stage vectors to identify
                                                         convergence to stable stage distribution
                                                         and to examine short-term dynamics
                             1.0




                                                                           seedling
                                                                           juvenile
                                                                           smadult
                             0.8




                                                                           medadult
                                                                           lrgadult
 Proportion in stage class

                             0.6
                             0.4
                             0.2
                             0.0




                                   0   5   10            15           20

                                                 Years
>eigA <- eigen.analysis(A)                    Another way to get population growth rates
                                              (lambda); you can also do sensitivity and
                                              elasticity analysis
>eigA
$lambda1
[1] 1.479709

$stable.stage
  seedling      juvenile     smadult     medadult      lrgadult
0.8378585732 0.1485391160 0.0107263172 0.0021988128 0.0006771808

$sensitivities
            seedling    juvenile   smadult     medadult      lrgadult
seedling 0.000000       0.000000 0.001603188 0.0003286412 0.0001012135
juvenile 1.123044       0.199098 0.000000000 0.0000000000 0.0000000000
smadult 0.000000        3.860464 0.278772083 0.0000000000 0.0000000000
medadult 0.000000       0.000000 0.985504705 0.2020209143 0.0000000000
lrgadult 0.000000        0.000000 0.000000000 0.6327777560 0.1948801362

$elasticities
             seedling    juvenile   smadult    medadult     lrgadult
seedling 0.0000000      0.00000000 0.03065508 0.01717155 0.07740224
juvenile 0.1252289      0.07386913 0.00000000 0.00000000 0.00000000
smadult 0.0000000       0.12522887 0.15354321 0.00000000 0.00000000
medadult 0.0000000      0.00000000 0.09457379 0.10744713 0.00000000
lrgadult 0.0000000      0.00000000 0.00000000 0.07740224 0.11747790

$repro.value
  seedling   juvenile smadult medadult lrgadult
  1.000000 8.967932 173.886116 614.715731 1925.436495

$damping.ratio
[1] 1.460202

>net.reproductive.rate(A)                            Calculates the net reproductive rate

[1] 127.5925

>generation.time(A)                                  Calculates the generation time

[1] 12.37438

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:0
posted:5/7/2013
language:Unknown
pages:4
gegouzhen12 gegouzhen12
About