search for: cortisol

Displaying 6 results from an estimated 6 matches for "cortisol".

Did you mean: cortijo
2012 Mar 19
2
by output into data frame
I could do this in various hacky ways, but what's the right way? I have a nice application of the by function, which does what I want. The output looks like this: > auc_stress lab.samples.stress$subid: 2 cortisol amylase 1 919.05 6834.8 --------------------------------------------------------------------------------------------------------------------------- lab.samples.stress$subid: 3 cortisol amylase 11 728.25 24422.05 etc. What I want is a data frame roughly like this: subid cortisol.auc a...
2012 May 16
2
trouble with ifelse statement
...39;m hoping someone can offer advice without it. This code below works and does what I want it to do, which is for a given row in my dataframe, where the variable "peak.cort" = max, it makes the value of another variable "max.cort" = to match the value of a third variable "cortisol" for that row. ************* index <- raw.saliva.data$peak.cort == 'max' raw.saliva.data$max.cort[index] <- (raw.saliva.data$cortisol[index]) ************* Now, I want to execute this function only if the value of a fourth variable, "sample" is >1 and &...
2012 Apr 23
2
plot function creating bars instead of lines
...s intended would be much appreciated. Thank you! ************ This is meant to plot a separate line for each subject for each challenge************* for (subj in unique(lab.samples$subid)) { #par(new=T) plot.new() par(mfrow=c(2,1)) par(mfg=c(1,1)) plot(data=lab.samples, subset=(subid==subj), cortisol ~ Sample, type='n', main=paste('Cortisol and Amylase for subject ', as.character(subj))) for ( t in unique(subset(lab.samples,subid==subj)$challenge) ) { par(mfg=c(1,1)) lines(data=lab.samples, subset=(subid==subj & challenge==t), cortisol ~ Sample, type='b'...
2023 Jan 30
2
question
Hi guys, I am using the cor() function to see if there are correlations between March cortisol levels and December cortisol levels and I'm trying to figure out if the function is doing what I want it to do. Each sample has it's own separate row in the CSV file that I'm working out of. March Cort and December Cort are different columns and they come from separate samples, therefo...
2005 Nov 21
1
(no subject)
Hi, I have written the following function to check whether a vector has elements satisfying monotonicity. is.monotone <- function(vec, increase=T){ # check for monotonicity in time-stamp data for cortisol collection ans <- TRUE vec.nomis <- vec[!is.na(vec)] if (increase & any(diff(vec.nomis,1) < 0, na.rm=T)) ans <- FALSE if (!increase & any(diff(vec.nomis,1) > 0, na.rm=T)) ans <- FALSE ans } This works correctly, but I get this error message as below. > x <- 2:10 &g...
2009 Mar 07
6
using a noisy variable in regression (not an R question)
Hi, This is not an R question, but I've seen opinions given on non R topics, so I wanted to give it a try. :) How would one treat a variable that was measured once, but is known to fluctuate a lot? For example, I want to include a hormone in my regression as an explanatory variable. However, this hormone varies in its levels throughout a day. Nevertheless, its levels differ substantially