[R-sig-eco] randomization

Tom_Philippi at nps.gov Tom_Philippi at nps.gov
Sun Jul 18 00:27:37 CEST 2010


The narrow answer to your question is that you can generate complete random
ordering as:
      sample(960)
or random orderings of food varieties presented to mothers with:
      FoodOrder <- sample(16)
or
      FoodOrder <- order(runif(16))
where your 16 foods are 4*FoodType + FoodVariety

Giving you that answer is almost malpractice.  The R code is the simplest
part of your problem; the best experimental design is the hard part.


Not knowing all of the details of your research (e.g., is your response
variable binary survival or some quantitative measure of growth, what
variation do you expect to be important, are you primarily interested in
insect species by food type interactions tested against insect species by
food variety nested within food type interactions, how many eggs can a
single individual lay, etc.), I'll take a quick stab at a couple of things
to think about.

1: Contra the second half of your last sentence ("How can I randomize the
order of food items and what insect species lays eggs on what food type the
best way by using R?"), I strongly recommend a balanced design, with each
insect species on all food varieties.  If individuals can lay 16 or more
eggs, I recommend balancing where each individual mom lays one egg on each
of the 16 food varieties.

2: Assuming that the experiment is set up by putting a mother on a sequence
of foods and having her oviposit; egg order within a mother may be as
important as variation among mothers.  If so, I recommend some form of
balanced Latin square design for the order of food varieties for each
female.  Several packages help with such experimental designs; you might
start with one of the design.* functions in package agricolae.

3: You propose 3 species, 4*4 food varieties, and 20 eggs per species *
food variety.  There are too many permutations of 16 food varieties to get
complete balance in a Latin square, but if you can increase your
experimental size by 20% I would recommend 3 species by 4*4 food varieties
by 24 eggs each combination (mothers).  Then, for each species, you can
Latin square at the level of the food types (4*3*2=24 orders), with
randomization of the order of food varieties within food types.  [Unless
you are more interested in varieties within types, in which case you should
Latin square on varieties within types and randomize on types.]

Tom

ps: I hope you don't run into problems with females refusing to oviposit on
some food varieties, or female willingness to oviposit on a variety being a
function of previous food experience!

-------------------------------------------
Tom Philippi, Ph.D.
Quantitative Ecologist
Inventory and Monitoring Program
National Park Service
1201 Oakridge Drive, Suite 150
Ft. Collins, CO   80525-5589
Tom_philippi at NPS.gov    (970) 225-3586
Fax (970) 225 3597
http://science.nature.nps.gov/im/monitor
-------------------------------------------



                                                                           
             shylock holmes                                                
             <tulugaq17 at hotmai                                             
             l.com>                                                     To 
             Sent by:                  <r-sig-ecology at r-project.org>       
             r-sig-ecology-bou                                          cc 
             nces at r-project.or                                             
             g                                                     Subject 
                                       [R-sig-eco] randomization           
                                                                           
             07/17/2010 04:46                                              
             PM ZW3                                                        
                                                                           
                                                                           
                                                                           





Hi all, I am totally new to R - never used it and just beginning to read
through the websites and posted notes to learn what and how R does things.
So for what I am planning on doing, I have no clue really, and wanted to
ask for some advice.

I have 3 insect species that I am planning on letting oviposit one egg onto
different diets (or hosts): there are 4 types of food with 4 variants of
each food type (i.e., original food type a, artificially created food type
a, artificial food type a with substitute x, artificial food type a with
substitute y, and so on for all other food types); I am also planning that
each food type with all variants is replicated 20 times per insect species
(in total 960 eggs with 320 eggs per insect species with 20 eggs on 16
different food variants as above). How can I randomize the order of food
items and what insect species lays eggs on what food type the best way by
using R?

Any suggestions are greatly appreciated!!!

Many thanks

_________________________________________________________________


             [[alternative HTML version deleted]]

_______________________________________________
R-sig-ecology mailing list
R-sig-ecology at r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology



More information about the R-sig-ecology mailing list