[R] Nested ANCOVA question

2012-12-03 Thread Sean Bignami
Hello R experts, I have having a difficult time figuring out how to perform and interpret an ANCOVA of my nested experimental data and would love any suggestions that you might have. Here is the deal: 1) I have twelve tanks of fish (1-12), each with a bunch of fish in them 2) I have three treat

[R] sapply( ) a loop function

2011-08-11 Thread Sean Bignami
Hello R-universe... I am having trouble writing a function which contains a loop so I can sapply() it to a list of data frames Each data frame has 241 observations of 15 variables. My loop takes a random sample of one row until the 40 consecutive rows after the sample have a d2p(variable) sum

[R] applying a loop to multiple dataframes

2011-07-22 Thread Sean Bignami
Hello again R-folks, I'm trying to apply a loop to multiple data frames and then organize the data in a manageable form. I have the code for my loop figured out (thanks to help from this list)...it runs up to 2000 iterations of a "while" loop until it finds a 40-row "d2p" column sum >5 n<-nrow(

[R] Select Random Rows from a dataframe

2011-07-21 Thread Sean Bignami
Hi all, I have a dataframe of behavioral observations from 360 fish, each with 241 observation points(rows), which looks like this: > head(d) fishtreatment tank trial video tid pid ang.chgabs.ac t lenvel d2p x y 1 1

[R] Non-linear Regression best-fit line

2011-06-17 Thread Sean Bignami
I am trying to fit a curve to a cumulative mortality curve (logistic) where y is the cumulative proportion of mortalities, and t is the time in hours (see below). Asym. at 0 and 1 > y [1] 0. 0.04853859 0.08303777 0.15201970 0.40995074 0.46444992 0.62862069 0.95885057 1. [10] 1.0