smatr                 package:smatr                 R Documentation

(_S_t_a_n_d_a_r_d_i_s_e_d) _M_a_j_o_r _A_x_i_s _E_s_t_i_m_a_t_i_o_n _a_n_d _T_e_s_t_i_n_g _R_o_u_t_i_n_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     This package provides methods of fitting bivariate lines in
     allometry using the major axis (MA) or standardised major axis
     (SMA), and for making inferences about such lines. The available
     methods of inference include confidence intervals and one-sample
     tests for slope and elevation, testing for a common slope or
     elevation amongst several allometric lines, constructing a
     confidence interval for a common slope or elevation, and testing
     for no shift along a common axis, amongst several samples.

_D_e_t_a_i_l_s:

     The key functions available in this package are the following.

     *For one sample:*

     _l_i_n_e._c_i_s fit allometric lines and construct confidence intervals
          for the true slope and elevation 

     _s_l_o_p_e._t_e_s_t test if the slope of an allometric line equals a
          specific value 

     _e_l_e_v._t_e_s_t test if the elevation of an allometric line equals a
          specific value 

     *For several samples:*

     _s_l_o_p_e._c_o_m test if several major axis or standardised major axis
          lines share a common slope, and construct a confidence
          interval for the true common slope 

     _e_l_e_v._c_o_m test if several major axis or standardised major axis
          lines share a common elevation, and construct a confidence
          interval for the true common elevation 

     _s_h_i_f_t._c_o_m test if several groups of observations have no shift in
          location along major axis or standardised major axis lines
          with a common slope 

     Options are available for forcing lines through the origin (where
     appropriate), and all procedures have the option of correcting for
     measurement error (although only in an approximate fashion, valid
     in large samples).

     Additional features of this package are listed below.

     *Measurement error estimation:*

     _m_e_a_s._e_s_t Estimates the average variance matrix of measurement
          error for a set of subjects with repeated measures 

     *Example datasets:*

     _l_e_a_f_l_i_f_e leaf longevity and leaf mass per area for plant species
          from different sites. Used to demonstrate the functionality
          of one-sample and multi-sample procedures 

     _l_e_a_f_m_e_a_s leaf mass per area and photosynthetic rate for plant
          species from different sites. Used to demonstrate the
          meas.est function 

     For more details, see the documentation for any of the individual
     functions listed above.

_A_u_t_h_o_r(_s):

     Warton, D. David.Warton@unsw.edu.au, translated to R by Ormerod,
     J. 2005-12-08

_R_e_f_e_r_e_n_c_e_s:

     Warton D. I. and Weber N. C. (2002) Common slope tests for
     bivariate structural relationships.  _Biometrical Journal_ *44*,
     161-174.

     Warton D. I., Wright I. J., Falster D. S. and Westoby M. (2006) A
     review of bivariate line-fitting methods for allometry. 
     _Biological Reviews_ (in press)

_S_e_e _A_l_s_o:

     'line.cis', 'slope.test', 'elev.test', 'slope.com', 'elev.com',
     'shift.com', 'meas.est', 'leaflife', 'leafmeas'

_E_x_a_m_p_l_e_s:

         #load the leaflife dataset:
         data(leaflife)

         #consider only the low rainfall sites:
         leaf.low.rain=leaflife[leaflife$rain=='low',]

         #construct a plot
         plot(log10(leaf.low.rain$lma), log10(leaf.low.rain$longev), xlab='leaf mass per area [log scale]', ylab='leaf longevity [log scale]')

         #test if the SMA slope amongst species at low rainfall sites is 1, for log (base 10) transformed data:
         slope.test(log10(longev), log10(lma), data=leaf.low.rain)
         
         #test if the MA slope is 2/3
         slope.test(log10(longev), log10(lma), data=leaf.low.rain, test.value = 2/3, method = 'MA')

         #produce CI's for MA slope and elevation:
         line.cis(log10(longev),log10(lma),data=leaf.low.rain, method=2)

         #now construct a scatterplot, with different colours for different sites
         plot(leaflife$lma,leaflife$longev,type="n",xlab="leaf mass per area [log scale]",ylab="leaf longevity [log scale]",log="xy")
         colours <- c("blue", "red", "green", "yellow")
         points(leaflife$lma,leaflife$longev,col=colours[as.numeric(leaflife$site)])
         legend(55,5,as.character(unique(leaflife$site)),col=colours,pch=rep(1,4))

         #test for a common SMA slope amongst species from sites with different rainfall/nutrients:
         fit.slopes <- slope.com(log10(longev), log10(lma), site, data = leaflife)

         #Test for common SMA slope amongst species at low rainfall sites with different levels of soil nutrients
         slope.com(log10(longev), log10(lma), soilp, data=leaf.low.rain)
         
         #Now test for common elevation of the groups fitted with an axis of common slope, at low rainfall sites:
         elev.com(log10(longev), log10(lma), soilp, data = leaf.low.rain)

         #Now test for no shift along the axes of common slope, for sites with different soil nutrient levels but low rainfall:
         shift.com(log10(longev), log10(lma), soilp, data=leaf.low.rain)

         #Test for common major axis slope, and construct 90
         slope.com(log10(longev), log10(lma), site, data=leaflife, method="MA", alpha=0.1)

         #Test for common elevation amongst the MA's of common slope, for low rainfall sites, and construct 99
         elev.com(log10(longev), log10(lma), soilp, method="MA", data = leaf.low.rain, alpha=0.01)

