![]() |
| Google translate tells me that the text reads "I refrain from smoking because cigarette butt or worms, it's all the same for a bird". An excellent point with an excellent illustration. Maison de la nature (nature center?), Lattes, near Montpellier, France, 05 August 2015. |
Tuesday, March 08, 2016
Worms or cigarette butts: all the same to a bird
Tuesday, March 01, 2016
Back to the past
Both from last summer and waaaay back. Here are a few more pictures from France this summer, at the Temple de Diane, which seems to have no actual relation to the goddess Diana.
| Le Temple de Diane, Les Jardins de la Fontaine, Nîmes, southern France, 29 July 2015. |
| There seems to be a problem with people climbing the monument. Temple de Diane, Les Jardins de la Fontaine, Nîmes, southern France, 29 July 2015. |
| Entering the temple! Temple de Diane, Les Jardins de la Fontaine, Nîmes, southern France, 29 July 2015. |
| This rat graffiti from 1738 might have been my favorite thing about the temple. Temple de Diane, Les Jardins de la Fontaine, Nîmes, southern France, 29 July 2015. |
| Pigeons everywhere in their native lands! Temple de Diane, Les Jardins de la Fontaine, Nîmes, southern France, 29 July 2015. |
| Nesting pigeons in the high arches. Temple de Diane, Les Jardins de la Fontaine, Nîmes, southern France, 29 July 2015. |
| Looking out at ground level. That shading thing is for tables at an adjacent cafe where we ate lunch afterwards. Temple de Diane, Les Jardins de la Fontaine, Nîmes, southern France, 29 July 2015. |
| In the gardens around the temple I found some critters. This appears to be some sort of hairstreak (Lycaenidae), but I haven't actually looked up what species it might be yet. Temple de Diane, Les Jardins de la Fontaine, Nîmes, southern France, 29 July 2015. |
| A shy new lizard friend. Temple de Diane, Les Jardins de la Fontaine, Nîmes, southern France, 29 July 2015. |
| You can walk around the side gardens (where I found the lizard and butterfly) and see neat views of the top of the temple. Temple de Diane, Les Jardins de la Fontaine, Nîmes, southern France, 29 July 2015. |
Tuesday, February 16, 2016
Adventures in compiling bgc for Bayesian estimation of genomic clines
Now that I have Ubuntu, installed the required libraries, and downloaded the program source code, I can install bgc. It took me a lot of following error messages and looking for files, so please go to the end to see my final commands to get it compiled. Even then, do not use my commands exactly. This post is more to show you how the compilation process went and where things went wrong. (Everywhere, that's where; mainly due to my inexperience.)
After reading the instruction manual for bgc, I ran this in the terminal:
/usr/local/src/bgcdist$ h5c++ -Wall -O2 -L/usr/include/gsl/lib -I/usr/local/gsl-1.15/include -o bgc
I got an error message:
The program 'h5c++' is currently not installed. You can install it by typing:
sudo apt-get install hdf5-helpers
So I did.
Note that I changed the directory for where to find GSL (highlighted) because I couldn't find it in usr/local. Eventually I gave up looking for it and uninstalled GSL, then downloaded it to install from source where I specified the directory using ./configure --prefix=/usr/local . (Spoiler alert: I mistyped this as "user/local" when I downloaded from source and this caused most of my problems later on. I believe I should have used the Ubuntu software center to resintall it and make sure I had all the GSL libraries I needed because when I reinstalled GSL at the very end, it worked fine from the software center.)
**********************************************************************
Done. The new package has been installed and saved to
/usr/local/src/gsl-1.16/gsl_1.16-1_amd64.deb
You can remove it from your system anytime using:
dpkg -r gsl
**********************************************************************
It still went into src. Hmm.
h5c++ -Wall -O2 -o bgc bgc_main.C bgc_func_readdata.C bgc_func_initialize.C bgc_func_mcmc.C bgc_func_write.C bgc_func_linkage.C bgc_func_ngs.C bgc_func_hdf5.C mvrandist.c -lgsl -lgslcblas
After reading the instruction manual for bgc, I ran this in the terminal:
/usr/local/src/bgcdist$ h5c++ -Wall -O2 -L/usr/include/gsl/lib -I/usr/local/gsl-1.15/include -o bgc
I got an error message:
The program 'h5c++' is currently not installed. You can install it by typing:
sudo apt-get install hdf5-helpers
So I did.
Note that I changed the directory for where to find GSL (highlighted) because I couldn't find it in usr/local. Eventually I gave up looking for it and uninstalled GSL, then downloaded it to install from source where I specified the directory using ./configure --prefix=/usr/local . (Spoiler alert: I mistyped this as "user/local" when I downloaded from source and this caused most of my problems later on. I believe I should have used the Ubuntu software center to resintall it and make sure I had all the GSL libraries I needed because when I reinstalled GSL at the very end, it worked fine from the software center.)
**********************************************************************
Done. The new package has been installed and saved to
/usr/local/src/gsl-1.16/gsl_1.16-1_amd64.deb
You can remove it from your system anytime using:
dpkg -r gsl
**********************************************************************
It still went into src. Hmm.
h5c++ -Wall -O2 -o bgc bgc_main.C bgc_func_readdata.C bgc_func_initialize.C bgc_func_mcmc.C bgc_func_write.C bgc_func_linkage.C bgc_func_ngs.C bgc_func_hdf5.C mvrandist.c -lgsl -lgslcblas
Be careful pasting from the manual, as in my terminal the underscores disappeared and then it couldn't find the files.
This gave me different errors, where it couldn't find GSL and compilation terminated.
h5c++ -Wall -O2 -L/usr/local/src/gsl-1.16 -I/usr/local/src/gsl-1.16 -o bgc bgc_main.C bgc_func_readdata.C bgc_func_initialize.C bgc_func_mcmc.C bgc_func_write.C bgc_func_linkage.C bgc_func_ngs.C bgc_func_hdf5.C mvrandist.c -lgsl -lgslcbla
This changed the missing files from those from gsl to one called hdf5.h.
h5c++ -Wall -O2 -L/usr/local/src/gsl-1.16 -I/usr/local/src/gsl-1.16 -prefix=/usr/local/src/hdf5-1.8.15-patch1/hdf5 -o bgc bgc_main.C bgc_func_readdata.C bgc_func_initialize.C bgc_func_mcmc.C bgc_func_write.C bgc_func_linkage.C bgc_func_ngs.C bgc_func_hdf5.C mvrandist.c -lgsl -lgslcbla
Nope.
Uninstalled hdf5. Then I found a recommendation to install an hdf5 cpp. Nope, still didn't work. (The observant or more experienced reader may note that I keep changing that last green-highlighted portion of the commands to have an s at the end or not. You will see below that this was of course a problem too.)
**********************************************************************
Finally, I was told that I had the prefixes wrongly specified (prefix just means it should be L or I, not actually saying prefix) and I had accidentally installed GSL into "user" instead of "usr" (the standard folder name). So this code below works because I needed to replace prefix with -I/, installed hdf5-dev and hdf5-serial-dev to get some of the files when they weren't found, and pointed the compiler to the wayward GSL files in the weird directory. I also sometimes forgot the s at the end of the green-highlighted command in previous attempts.
h5c++ -Wall -O2 -L/user/local/lib -L/usr/local/src/hdf5-1.8.15-patch1/hdf5/lib/ -I/usr/local/src/gsl-1.16 -I/usr/local/src/hdf5-1.8.15-patch1/hdf5/include/ -o bgc bgc_main.C bgc_func_readdata.C bgc_func_initialize.C bgc_func_mcmc.C bgc_func_write.C bgc_func_linkage.C bgc_func_ngs.C bgc_func_hdf5.C mvrandist.c -lgsl -lgslcblas
As with most things, essentially the installation process is following the error messages. If the compiler can't find a file, make sure the compile commands point to the correct directories (search for where the file is located), or go install the package/library or a related thing (like the -dev versions of hdf5) if it can't find it because it doesn't exist yet. Finally, when I went to run the compiled bgc, it turned out that the bgc program still couldn't find GSL in the misnamed "user" folder anyway. I uninstalled GSL (using the Ubuntu software center), reinstalled it, and bgc started then.
UPDATE 2016/07/14: This is much easier if you don't fill your commands with typos and install the required packages in the correct places. I upgraded to Ubuntu 16.04 LTS and it apparently removed GSL, so bgc no longer ran. I reinstalled gsl and the gsl development versions from the command line this time using 'sudo apt-get install gsl-bin libgsl-dev'. That presumably put them in the right place this time. I then navigated to the bgcdist folder where the files were stored, and ran the exact compiling command from the user manual/documentation. I was dreading a multi-hour fiasco again and it just worked. I think the moral of the story here is that this is a lot easier if you have installed packages a few times in Ubuntu by the time you attempt this, but it is doable even if you are brand new.
This changed the missing files from those from gsl to one called hdf5.h.
h5c++ -Wall -O2 -L/usr/local/src/gsl-1.16 -I/usr/local/src/gsl-1.16 -prefix=/usr/local/src/hdf5-1.8.15-patch1/hdf5 -o bgc bgc_main.C bgc_func_readdata.C bgc_func_initialize.C bgc_func_mcmc.C bgc_func_write.C bgc_func_linkage.C bgc_func_ngs.C bgc_func_hdf5.C mvrandist.c -lgsl -lgslcbla
Nope.
Uninstalled hdf5. Then I found a recommendation to install an hdf5 cpp. Nope, still didn't work. (The observant or more experienced reader may note that I keep changing that last green-highlighted portion of the commands to have an s at the end or not. You will see below that this was of course a problem too.)
**********************************************************************
Finally, I was told that I had the prefixes wrongly specified (prefix just means it should be L or I, not actually saying prefix) and I had accidentally installed GSL into "user" instead of "usr" (the standard folder name). So this code below works because I needed to replace prefix with -I/, installed hdf5-dev and hdf5-serial-dev to get some of the files when they weren't found, and pointed the compiler to the wayward GSL files in the weird directory. I also sometimes forgot the s at the end of the green-highlighted command in previous attempts.
h5c++ -Wall -O2 -L/user/local/lib -L/usr/local/src/hdf5-1.8.15-patch1/hdf5/lib/ -I/usr/local/src/gsl-1.16 -I/usr/local/src/hdf5-1.8.15-patch1/hdf5/include/ -o bgc bgc_main.C bgc_func_readdata.C bgc_func_initialize.C bgc_func_mcmc.C bgc_func_write.C bgc_func_linkage.C bgc_func_ngs.C bgc_func_hdf5.C mvrandist.c -lgsl -lgslcblas
As with most things, essentially the installation process is following the error messages. If the compiler can't find a file, make sure the compile commands point to the correct directories (search for where the file is located), or go install the package/library or a related thing (like the -dev versions of hdf5) if it can't find it because it doesn't exist yet. Finally, when I went to run the compiled bgc, it turned out that the bgc program still couldn't find GSL in the misnamed "user" folder anyway. I uninstalled GSL (using the Ubuntu software center), reinstalled it, and bgc started then.
UPDATE 2016/07/14: This is much easier if you don't fill your commands with typos and install the required packages in the correct places. I upgraded to Ubuntu 16.04 LTS and it apparently removed GSL, so bgc no longer ran. I reinstalled gsl and the gsl development versions from the command line this time using 'sudo apt-get install gsl-bin libgsl-dev'. That presumably put them in the right place this time. I then navigated to the bgcdist folder where the files were stored, and ran the exact compiling command from the user manual/documentation. I was dreading a multi-hour fiasco again and it just worked. I think the moral of the story here is that this is a lot easier if you have installed packages a few times in Ubuntu by the time you attempt this, but it is doable even if you are brand new.
Tuesday, February 09, 2016
Recent snow-birding
Tuesday, February 02, 2016
New paper: anthropogenic noise affects detectability in grassland bird surveys mainly via errors in distance estimates
My post-doc mentor, Dr. Nicola Koper, has recently published a new (open access) paper on the effects of ambient noise on detectability in grassland birds in Ecology and Evolution (I am a co-author on this paper) on whether bird survey results might be affected by anthropogenic noise. The main message is that species are still detectable, but noise can affect observers' ability to estimate distances to unseen vocalizing birds.
Tuesday, January 26, 2016
Repeatability, intraclass correlation coefficient, and measurement error in R and SAS
Measurement error is "the variability of repeated measurements [...] relative to its variability among individuals in a particular group" (Bailey and Byrnes 1990, pg 124). In other words, how much wobble is there in repeated samples on the same individual? I used measurement error in Curry and Patten (2014) after learning about the idea in a graduate multivariate statistics class I took a few years ago. Papers such as Lougheed et al. (1991) and Marantz and Patten (2010) showed implementations. I am now wanting to implement the same idea for repeated songs by the same individual bird in a species that sings one song type per individual. How much does a bird vary in repeats of its standardized song?
I first started looking for how to implement a model II nested random effects ANOVA (as described in Bailey and Byrnes 1990), like SAS's PROC NESTED but in R, and ran into the usual problems trying to get the two programs to give equivalent output (where were my mean squares in R? So aggravating sometimes...). I was also looking to see exactly how a similar concept that I just learned about, repeatability (Lessells and Boag 1987; also known as the intraclass correlation coefficient), was related. At first I thought they were the same thing, but after carefully writing out the equations from both Bailey and Byrnes (1990) and Lessells and Boag (1987), I realized they can be calculated easily from one another (and I was backed up by further reading in Wolak et al. 2012, pg. 130, who state "measurement error is simply one minus the repeatability", as I had suspected). Measurement error uses within-groups mean square error (or variance within groups) as the numerator in the calculation, while the intraclass correlation coefficient (or repeatability) uses the among-group variance (which both Lessells and Boag 1987 and Bailey and Byrnes 1990 show to calculate using the same method).
As an aside, repeatability appears to be used rather broadly, and intraclass correlation coefficient also appears to have some other defintions, if wikipedia's summary is to be believed, but in the papers I am citing they all are comparing within and among group variation (the ANOVA framework).
Armed with this new terminology and knowledge, I decided to use the R package 'ICC' (Wolak et al. 2012) which calculates repeatability. I tested this on some sample data from the SAS website with both the model II nested ANOVA as used in Bailey and Byrnes (1990) and in R.
Use the "turnip" dataset as the SAS website shows, then run this modified code:
proc nested data=turnip;
classes plant;
var calcium;
run;
To get this:
Calculate repeatability with these highlighted numbers using is the equation from Lessells and Boag (1987); 6 is the number of samples per individual, i.e. the number of repeated measurements:
((2.520115-0.135502)/6)/(0.135502+((2.520115-0.135502)/6))
Repeatability=0.745745
To calculate measurement error, substitute 0.135502 for the current numerator (i.e. use the Bailey and Byrnes 1990 equation).
0.135502/(0.135502+((2.520115-0.135502)/6))
Using the ICC package's function ICCest() gives essentially the same answer (the difference appears to be the level of precision in the decimal places), but also provides confidence intervals and other data that are explained more in the Wolak et al. paper. (Import the data first, obviously, before running this code. You can enter it by hand or export from SAS as a .csv).
ICCest(x=plant, y=calcium, data=turnip)
The highlighted number is repeatability, which is essentially the same as the calculation by hand from SAS barring what I believe are differences in decimal precision used in the numbers for calculating the answer.
Finally, since SAS uses a random effects model, I hoped that one might be able to calculate measurement error by hand from R just to be sure it all works. I found a page comparing different methods of repeatability in R that showed an example using the package 'lme4'. Calcium is the measured variable, plant is the random effect, and there are no fixed effects.
model.repeat<-lmer(calcium~1+(1|plant),
data=turnip)
summary(model.repeat)
>results>Linear mixed model fit by REML t-tests use Satterthwaite >approximations to degrees
> of freedom [lmerMod]
>Formula: calcium ~ 1 + (1 | plant)
> Data: turnip
>
>REML criterion at convergence: 31.2
>
>Scaled residuals:
> Min 1Q Median 3Q Max
>-1.09999 -0.85753 -0.09009 0.69564 2.13276
>
>Random effects:
> Groups Name Variance Std.Dev.
> plant (Intercept) 0.3974 0.6304
> Residual 0.1355 0.3681
>Number of obs: 24, groups: Plant, 4
>
>Fixed effects:
> Estimate Std. Error df t value Pr(>|t|)
>(Intercept) 3.012 0.324 3.000 9.295 0.00264 **
>---
>Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Use the residual (error, or within) as the numerator if you want to calculate measurement error, or the plant (among groups) variance as the numerator if you want to calculate repeatability. For example, for measurement error, you get pretty close to the SAS-by-hand number.
0.1355/(0.3974+0.1355)
Measurement error=0.2542691
So, all three methods (by hand with lme4 in R, using the ICC package in R, and by hand from SAS PROC NESTED) give comparable results for the balanced design (for the plant dataset, n=6 for every individual plant, i.e. there are six measurements for any given plant). For an unbalanced design, with varying numbers of measurements per group, Lessells and Boag (1987) provide an equation to calculate the appropriate sample size coefficient n0 (see their equation 5). The ICC package uses that equation to calculate n0 (Wolak et al. 2012; this is listed as $k in the output from ICCest) I tested this in the R packages only as I was hoping the variance from lme4 might have already been adjusted for the sample size coefficient issue. ICC already states that they adjust (Wolak et al. 2012 and in the help file). With the first row deleted from the turnip data set, ICC gives a repeatability value of 0.7432083 and k (which is n0 from Lessells and Boag)= 5.73913 (slightly under the previous 6, which makes sense as I deleted one row). With that same one-row-deleted data using lme4, I took the random effects variances (0.3952/(0.1419+0.3952)) and got 0.7358034, so its variance calculation is not including the repeatability adjustment for n0. This is not really surprising since that's not what it's designed to do.
So, what I will be doing to check for "measurement error" on my birds (how much "wobble" each bird has in its otherwise standard songs) is substitute the song variable (let's say frequency) for "calcium" and the bird ID (individual ID or band number) for "plant". The random effect in lmer, the classes in SAS PROC NESTED, and x in ICCest are all the individual/subject/item from which you get repeated measurements for measurement error or repeatability.
Take home message: ICC is the easiest to use as it will take into account an unbalanced design for you already. With SAS you can calculate for an unbalanced design but you'll have to do it by hand. Thus, ICC and SAS should cover all cases. With lme4 you can calculate repeatability and measurement error for balanced designs by hand, but I don't see a particularly obvious way to get the mean squares as in SAS (and I need to move on to other parts for the analysis), so I'm going to leave it at that for now.
Here are the papers I used to understand how to calculate measurement error and repeatability:
Bailey RC, Byrnes J. 1990. A new, old method for assessing measurement error in both univariate and multivariate morphometric studies. Systematic Biology 39:124–130.
Lessells CM, Boag PT. 1987. Unrepeatable repeatabilities: a common mistake. Auk 104:116–121.
Wolak ME, Fairbairn DJ, Paulsen YR. 2012. Guidelines for estimating repeatability. Methods in Ecology and Evolution 3:129-137.
and here are some helpful examples of papers that use measurement error:
Lougheed SC, Arnold TW, Bailey RC. 1991. Measurement error of external and skeletal variables in birds and its effect on principal components. Auk 108:432–436.
Marantz CA, Patten MA. 2010. Quantifying subspecies analysis: a case study of morphometric variation and subspecies in the woodcreeper genus Dendrocolaptes. Ornithological Monographs 67:123–140.
I first started looking for how to implement a model II nested random effects ANOVA (as described in Bailey and Byrnes 1990), like SAS's PROC NESTED but in R, and ran into the usual problems trying to get the two programs to give equivalent output (where were my mean squares in R? So aggravating sometimes...). I was also looking to see exactly how a similar concept that I just learned about, repeatability (Lessells and Boag 1987; also known as the intraclass correlation coefficient), was related. At first I thought they were the same thing, but after carefully writing out the equations from both Bailey and Byrnes (1990) and Lessells and Boag (1987), I realized they can be calculated easily from one another (and I was backed up by further reading in Wolak et al. 2012, pg. 130, who state "measurement error is simply one minus the repeatability", as I had suspected). Measurement error uses within-groups mean square error (or variance within groups) as the numerator in the calculation, while the intraclass correlation coefficient (or repeatability) uses the among-group variance (which both Lessells and Boag 1987 and Bailey and Byrnes 1990 show to calculate using the same method).
As an aside, repeatability appears to be used rather broadly, and intraclass correlation coefficient also appears to have some other defintions, if wikipedia's summary is to be believed, but in the papers I am citing they all are comparing within and among group variation (the ANOVA framework).
Armed with this new terminology and knowledge, I decided to use the R package 'ICC' (Wolak et al. 2012) which calculates repeatability. I tested this on some sample data from the SAS website with both the model II nested ANOVA as used in Bailey and Byrnes (1990) and in R.
Use the "turnip" dataset as the SAS website shows, then run this modified code:
proc nested data=turnip;
classes plant;
var calcium;
run;
To get this:
Calculate repeatability with these highlighted numbers using is the equation from Lessells and Boag (1987); 6 is the number of samples per individual, i.e. the number of repeated measurements:
((2.520115-0.135502)/6)/(0.135502+((2.520115-0.135502)/6))
Repeatability=0.745745
To calculate measurement error, substitute 0.135502 for the current numerator (i.e. use the Bailey and Byrnes 1990 equation).
0.135502/(0.135502+((2.520115-0.135502)/6))
Measurement error=0.254255
Adding the two numbers together gets 1, which means all the variation is accounted for (and thus you only need to calculate one; to get the other just subtract from 1).
Using the ICC package's function ICCest() gives essentially the same answer (the difference appears to be the level of precision in the decimal places), but also provides confidence intervals and other data that are explained more in the Wolak et al. paper. (Import the data first, obviously, before running this code. You can enter it by hand or export from SAS as a .csv).
ICCest(x=plant, y=calcium, data=turnip)
>$ICC
>[1] 0.7457443
>
>$LowerCI
>[1] 0.3889918
>
>$UpperCI
>[1] 0.9776527
>
>$N
>[1] 4
>
>$k
>[1] 6
>
>$varw
>[1] 0.1355025
>
>$vara
>[1] 0.3974355
Finally, since SAS uses a random effects model, I hoped that one might be able to calculate measurement error by hand from R just to be sure it all works. I found a page comparing different methods of repeatability in R that showed an example using the package 'lme4'. Calcium is the measured variable, plant is the random effect, and there are no fixed effects.
model.repeat<-lmer(calcium~1+(1|plant),
data=turnip)
summary(model.repeat)
>results>Linear mixed model fit by REML t-tests use Satterthwaite >approximations to degrees
> of freedom [lmerMod]
>Formula: calcium ~ 1 + (1 | plant)
> Data: turnip
>
>REML criterion at convergence: 31.2
>
>Scaled residuals:
> Min 1Q Median 3Q Max
>-1.09999 -0.85753 -0.09009 0.69564 2.13276
>
>Random effects:
> Groups Name Variance Std.Dev.
> plant (Intercept) 0.3974 0.6304
> Residual 0.1355 0.3681
>Number of obs: 24, groups: Plant, 4
>
>Fixed effects:
> Estimate Std. Error df t value Pr(>|t|)
>(Intercept) 3.012 0.324 3.000 9.295 0.00264 **
>---
>Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Use the residual (error, or within) as the numerator if you want to calculate measurement error, or the plant (among groups) variance as the numerator if you want to calculate repeatability. For example, for measurement error, you get pretty close to the SAS-by-hand number.
0.1355/(0.3974+0.1355)
Measurement error=0.2542691
So, all three methods (by hand with lme4 in R, using the ICC package in R, and by hand from SAS PROC NESTED) give comparable results for the balanced design (for the plant dataset, n=6 for every individual plant, i.e. there are six measurements for any given plant). For an unbalanced design, with varying numbers of measurements per group, Lessells and Boag (1987) provide an equation to calculate the appropriate sample size coefficient n0 (see their equation 5). The ICC package uses that equation to calculate n0 (Wolak et al. 2012; this is listed as $k in the output from ICCest) I tested this in the R packages only as I was hoping the variance from lme4 might have already been adjusted for the sample size coefficient issue. ICC already states that they adjust (Wolak et al. 2012 and in the help file). With the first row deleted from the turnip data set, ICC gives a repeatability value of 0.7432083 and k (which is n0 from Lessells and Boag)= 5.73913 (slightly under the previous 6, which makes sense as I deleted one row). With that same one-row-deleted data using lme4, I took the random effects variances (0.3952/(0.1419+0.3952)) and got 0.7358034, so its variance calculation is not including the repeatability adjustment for n0. This is not really surprising since that's not what it's designed to do.
So, what I will be doing to check for "measurement error" on my birds (how much "wobble" each bird has in its otherwise standard songs) is substitute the song variable (let's say frequency) for "calcium" and the bird ID (individual ID or band number) for "plant". The random effect in lmer, the classes in SAS PROC NESTED, and x in ICCest are all the individual/subject/item from which you get repeated measurements for measurement error or repeatability.
Take home message: ICC is the easiest to use as it will take into account an unbalanced design for you already. With SAS you can calculate for an unbalanced design but you'll have to do it by hand. Thus, ICC and SAS should cover all cases. With lme4 you can calculate repeatability and measurement error for balanced designs by hand, but I don't see a particularly obvious way to get the mean squares as in SAS (and I need to move on to other parts for the analysis), so I'm going to leave it at that for now.
Here are the papers I used to understand how to calculate measurement error and repeatability:
Bailey RC, Byrnes J. 1990. A new, old method for assessing measurement error in both univariate and multivariate morphometric studies. Systematic Biology 39:124–130.
Wolak ME, Fairbairn DJ, Paulsen YR. 2012. Guidelines for estimating repeatability. Methods in Ecology and Evolution 3:129-137.
and here are some helpful examples of papers that use measurement error:
Lougheed SC, Arnold TW, Bailey RC. 1991. Measurement error of external and skeletal variables in birds and its effect on principal components. Auk 108:432–436.
Marantz CA, Patten MA. 2010. Quantifying subspecies analysis: a case study of morphometric variation and subspecies in the woodcreeper genus Dendrocolaptes. Ornithological Monographs 67:123–140.
Labels:
Blog,
code,
learning happens,
R,
SAS,
statistics
Tuesday, January 19, 2016
Subscribe to:
Posts (Atom)


