search for: individual_id

Displaying 8 results from an estimated 8 matches for "individual_id".

2011 Dec 27
2
How to create a loop and then extract values from the list generated by cor.test
Dear all, I would like to conduct a Pearson's correlation using cor.test separately for each individual in my data set. Each individual has nine observations of the measurement variable 'Delta13C'. I can figure our how to do it manually one 'Individual_ID' at a time, but I cannot figure out how to automate the process (a loop I am guessing). In addition, I would like to generate a new data frame that has the each individual's 'Individual_ID', the pearson correlation 'estimate', and the 'p.valve'. The output table wou...
2011 Dec 28
2
convert variable types when creating data frame from cor.test results
Dear list, The below dataset and code creates a new dataset with the results from the function cor.test being performed on each individual ('Individual_ID') from my original dataset. How do I convert each variable from the cor.test results to a numeric data type, as it is passed into the new dataframe? For example, 'estimate', 'p.value', and 'conf.int' should be numeric not character. Second, I would like variable 'con...
2011 Dec 19
1
calculating correlation coefficients on repeated measures
Dear list, I have 9 repeated measures (measurement variable == 'Delta13C') for individuals (ID variable == 'Individual_ID'. Each repeated measure is "indexed" (right term?) by the variable 'FeatherPosition' and given as c('P1', 'P2', 'P3', 'P4', 'P5', 'P6', 'P7', 'P8', 'P9'). I would like to calculate a correlation coefficien...
2007 Apr 06
0
translating sas proc mixed to lme()
...All I am trying to translate a proc mixed into a lme() syntax. It seems that I was able to do it for part of the model, but a few things are still different. It is a 2-level bivariate model (some call it a pseudo-3-level model). PROC MIXED DATA=psdata.bivar COVTEST METHOD = ml; CLASS cluster_ID individual_id variable_id ; MODEL y = Dp Dq / SOLUTION NOINT; RANDOM Dp Dq / SUBJECT = cluster_ID TYPE=UN G GCORR; REPEATED variable_id / SUBJECT = individual_ID(cluster_ID) TYPE=UN R RCORR; RUN; Here is my try: dta = sqlQuery(odbcConnect("sasodbc", believeNRows=FALSE), "select * from psdata.bi...
2009 Jan 30
2
Subsetting without partial matches
...uals. I would like to make a list of individuals, with a data frame of observations for each individual. The following code usually works, but not always ---------------------------------------------------------------------- # Make a list of empty data frames animals = list() indivs = levels(Z$individual_id) donotprint <- sapply(indivs, function(i){ animals[[i]] = data.frame() }) # Add observations of each animal to the appropriate frame donotprint <- apply(Z, 1, function(r){ ind = r[["individual_id"]] bind = ind # Use different names to confirm that the partial matching is...
2011 Dec 18
1
Identifying records with the correct number of repeated measures
...d 2) when I subset my dataset my 'factor' variables contain all the levels from the complete dataset, how can I reset these factor variables to condense my 'dump' file as much as possible? Many Holiday Cheers from a NEW R user! Keith Sample data: WW_Sample_SI <- structure(list(Individual_ID = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 5L ), .Label = c("WW_08I_01", "WW_08I_02", "WW_08I_03", "WW_08I_04", "WW_08I_05"), class = "factor"), Site_Name = structure(c(1L, 1L, 1L, 1L, 1L,...
2009 Apr 20
1
doing zero inflated glmm for count data with fmr
...sponse variable). ta: the ambient temperature at the foraging tray. habitat: the habitat type of the foraging tray. season: the season in which the experiment session took place (summer or winter). moon: the moon phase (new or full). position: a random factor (I had 4 foraging stations) individual_id: a random factor indicating the individual foraged in the tray. This is the lmer parameters I have used: model<-lmer(count~ta*habitat*season*moon + (1|individual_id) + (1|position), data=countdata, family=poisson) I would really appreciate the help. I love working with R and it really chang...
2012 Oct 28
6
Having some Trouble Data Structures
...quot;insert list into matrix" I get results like how to turn one into another, which is not what I think I need to be doing. I have been considering having several data structures not nested in each other, something like for every individual create a new matrix object with the name Effectors_[Individual_ID] and some how get my simulation loops operating on those objects but I find it hard to see how to tell R all of those matrices are to be included in an operation, as you can all lines of a data frame for example with for loops. This is strange for me because this model was written in a macro-code f...