Displaying 20 results from an estimated 6000 matches similar to: "plot function creating bars instead of lines"
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
---------------------------------------------------------------------------------------------------------------------------
2012 May 16
2
trouble with ifelse statement
Hello,
I apologize in advance for not providing sample data, I'm a very new to R
and can't easily generate appropriate sample data quickly. I'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
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, therefore
2002 Oct 08
2
data.frame merge matching several columns
Greetings,
Is it possible to match several columns in a merge statement? Here is my
problem:
data1 looks like this...
SUBID TARGID ITEM RATING
1 1 1 4
1 1 2 5
1 1 3 3
1 1 4 2
1 1 5 5
......
SUBID is the ID for the raters, TARGID is the ID for the targets being
rated, ITEM ranges from 1 to 64 crossed
2010 Nov 18
3
New Sampling question
I have another question about drawing samples from a data frame. This might
sound really tricky. Let me use a data frame I have posted earlier as an
example:
SubID CSE1 CSE2 CSE3 CSE4 WSE1 WSE2 WSE3 WSE4
1 6 5 6 2 6 2 2 4
2 6 4 7 2 6 6 2 3
3 5 5 5 5
2011 Jan 18
3
error message
I was running a sampling syntax based on a data frame (ago) of 160 rows and
25 columns. Below are the column names:
> names(ago)
[1] "SubID" "AGR1" "AGR2" "AGR3" "AGR4" "AGR5" "AGR6" "AGR7"
"AGR8"
[10] "AGR9" "AGR10" "WAGR1" "WAGR2"
2010 Apr 30
2
deriving mean from specific cases
Hi all,
I have a large dataset that has >10k entries. The dataset is stored in a
dataframe with the headers:
SubID Condition1 Condition2 Result1 Result2
There are multiple entries for a given SubID(Subject ID). Condition 1 has 3
levels and condition2 has 2 levels (therefore there are 6 possible
combinations all together e.g. Cond1 Level1 x Cond2 Level 1 etc.) and i need
to compute for
1. The
2007 Aug 01
1
Problem to remove loops in a routine
Dear R-users,
I have written the following code to generate some trellis plots. It
works perfectly fine except that it is quite slow when it is apply to my
typical datasets (over several thousands of lines). I believe the
problem comes from the loops I am using to subset my data.frame. I read
in the archives that the tapply function is often more efficient than a
loop in R. Unfortunately ,
2007 Nov 13
1
TRUNCATED error with data frame
Hi ,
I am new to R.
I am trying to run a simple R script as shown below:
aov.R
------
data1<-c(49,47,46,47,48,47,41,46,43,47,46,45,48,46,47,45,49,44,44,45,42,45,45,40
,49,46,47,45,49,45,41,43,44,46,45,40,45,43,44,45,48,46,40,45,40,45,47,40)
matrix(data1, ncol= 4, dimnames = list(paste("subj", 1:12),
c("Shape1.Color1",
"Shape2.Color1", "Shape1.Color2",
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,
2008 May 30
2
inconsistent output when using variable substitution
I am extremely puzzled by this behavior in R. I have a data frame called
Trials in which I have results from an experiment. I am trying to do a
subjects analysis, but getting weird results. Each row has 1 trial in it,
which includes a column for the subject number I get the list of subject
numbers like so:
> Subj=unique(sort(Trials$Subj))
Then I loop over them. But I get strange results. As
2011 Jan 11
1
how to sort new data frame based on the original data frame
I have a really simple question
I have a data frame of 8 variables (the first column is the subjects' id):
SubID G1 G2 G3 G4 W1 W2 W3 W4
1 6 5 6 2 6 2 2 4
2 6 4 7 2 6 6 2 3
3 5 5 5 5 5 5 4 5
2012 Jan 06
1
lme model specification problem (Error in MEEM...)
Dear all,
In lme, models in which a factor is fully "contained" in another lead to
an error. This is not the case when using lm/aov.
I understand that these factors are aliased, but believe that such
models make sense when the factors are fitted sequentially. For example,
I sometimes fit a factor first as linear term (continuous variable with
discrete levels, e.g. 1,2,4,6), and
2008 Feb 05
1
Extracting level-1 variance from lmer()
All,
How does one extract the level-1 variance from a model fit via lmer()?
In the code below the level-2 variance component may be obtained via
subscripting, but what about the level-1 variance, viz., the 3.215072 term?
(actually this term squared) Didn't see anything in the archives on this.
Cheers,
David
> fm <- lmer( dv ~ time.num*drug + (1 | Patient.new), data=dat.new )
2004 Mar 19
2
for loop or Hmisc library trap.rule function syntax error
Hello:
I am new R user stumped why the R code after this paragraph generates "Error:
syntax error" messages after each of the last 2 lines. I have tried searching
the manuals, Hmisc documentation, contributed manuals, help archives, and
Internet. I am running R 1.7.1 under Windows 2000 (I will upgrade when my
imminent OS upgrade happens). My data was successfully entered and
2008 Dec 17
1
repeated measures aov with weights
Dear R-help,
I'm facing a problem with defining a repeated measures anova with
weighted data.
Here's the code to reproduce the problem:
# generate some data
seed=11
rtrep <- data.frame(rt=rnorm(100),ti=rep(1:5,20),subj=gl
(20,5,100),we=runif(100))
# model with within factor for subjects/repeated measurements, no
problem
aov(rt~ti + Error(subj/ti),data=rtrep)
#model with weights
2008 Sep 11
1
plot of all.effects object
All,
I'm trying to plot an all.effects() object, as shown in the help for
all.effects and also Crawley's R book (p.178, 2007). The data has a repeated
measures structure, but I'm using all.effects for the simple lm() fit here.
Below is a reproducible example that yields the error message.
fm.ex = lm(dv ~ time.num*drug*X, data = dat.new)
fm.effects = all.effects(fm.ex, xlevels =
2008 Sep 19
1
Type I SS and Type III SS problem
Dear all:
I m a newer on R.? I have some problem when I use?anova function.? I use anova function to get Type I SS results, but I also need to get Type III SS results.? However, in my code, there is some different between the result of Type I SS and Type III SS.? I don?t know why the ?seqe? factor disappeared in the result of Type III SS.? How can I do??
Here is my example and result.
2003 Dec 17
1
repeated measures aov problem
Hi all,
I have a strange problem and rigth now I can't figure out a
solution.
Trying to calculate an ANOVA with one between subject factor (group)
and one within (hemisphere). My dependent variable is source
localization (data). My N = 25.
My data.frame looks like this:
> ML.dist.stack
subj group hemisphere data
1 1 tin left 0.7460840
2 2 tin left
2007 May 16
1
lmer error confusion
Hi All.
I'm trying to run a simple model from Baayan, Davidson, & Bates and getting
a confusing error message. Any ideas what I'm doing wrong here?
# Here's the data.....
Subj <- factor(rep(1:3,each=6))
Item <- factor(rep(1:3,6))
SOA <- factor(rep(0:1,3,each=3))
RT <-
c(466,520,502,475,494,490,516,566,577,491,544,526,484,529,539,470,511,528)
priming