Displaying 20 results from an estimated 1000 matches similar to: "conditional IF with AND"
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
2010 Feb 16
1
difftimes; histogram; memory problems
Hi All:
Let's say I have two dataframes (Condition1 and Condition2); each
being on the order of 12,000 and 16,000 rows; 1 column. The entries
contain dates.
I'd like to calculate, for each possible pair of dates (that is:
Condition1[1:10,000] and Condition2[1:10,000], the number of days
difference between the dates in the pair. The result should be a
matrix 12,000 by 16,000. Really,
2008 Jul 27
4
product of successive rows
Hi everyone,
I want to perform an operation on a matrx that outputs the product of
successive pairs of rows. For example: calculating the product between rows
1 & 2; 3 & 4; 5 & 6...etc.
Does anyone know of any readily available functions that can do this?
Thanks,
rcoder
--
View this message in context: http://www.nabble.com/product-of-successive-rows-tp18681259p18681259.html
2012 Nov 24
2
Performing operations only on selected data
I spent some time on this simple question, also searched the forum,
eventually hacked my way to an ugly solution for my particular problem but I
would like to improve my coding:
I have data of the form:
df <- expand.grid(group=c('copper', 'zinc', 'aluminum', 'nickel'),
condition1=c(1:4))
I would like to add a new data column "condition2", with values
2010 May 20
1
Mixed Effects Model on Within-Subjects Design
Dear R Experts,
I am attempting to run a mixed effects model on a within-subjects repeated
measures design, but I am unsure if I am doing it properly. I was hoping
that someone would be able to offer some guidance.
There are 5 independent variables (subject, condition, difficulty,
repetition) and 1 dependent measure (value). Condition and difficulty are
fixed effects and have 3 levels each
2008 Aug 25
1
lattice : using both strip and strip.left
Dear all,
I'm routinely using lattice and ggplot2, I wish to create a lattice
theme that looks not too dissimilar to ggplot's defaults so I can
include both graphs in a document with a consistent look.
To illustrate my questions, consider the following example:
> library(ggplot2)
> library(lattice)
>
> # example data
> x <- seq(0, 10, len = 100)
> y1 <-
2014 Sep 25
5
[LLVMdev] New type of smart pointer for LLVM
Hello everyone,
I bring to discussion the necessity/design of a new type of smart
pointer. r215176 and r217791 rise the problem, D5443
<http://reviews.llvm.org/D5443> is devoted to the solution.
r215176 applies several temporary ugly fixes of memory leaks in
TGParser.cpp which would be great to be refactored using smart pointers.
D5443 <http://reviews.llvm.org/D5443> demonstrates
2011 Dec 08
1
prop.test() and the simultaneous confidence interval for multiple proportions in R
Dear list members,
I want to perform in R the analysis "simultaneous confidence interval for multiple proportions", as illustrated in the article of Agresti et al. (2008) "Simultaneous confidence intervals for comparing binomial parameter", Biometrics 64, 1270-1275.
If I am not wrong the R function implementing the Agresti et al. method is prop.test(). I ask an help because I
2010 May 31
1
Post-hoc tests for repeated measures in balanced experimental design
Hi,
I am performing experiments in the field of visual perception where
we often apply balanced designs. Within a group of normal subjects,
we vary different stimulus conditions (like contrast, luminance,
temporal frequency of stimulation) and derive some psychophysical or
electrophysiological results from our subjects. Often, the main
question is to test the effect of these parameters
2008 Aug 12
7
ignoring zeros or converting to NA
Hi everyone,
I have a matrix that has a combination of zeros and NAs. When I perform
certain calculations on the matrix, the zeros generate "Inf" values. Is
there a way to either convert the zeros in the matrix to NAs, or only
perform the calculations if not zero (i.e. like using something similar to
an !all(is.na() construct)?
Thanks,
rcoder
--
View this message in context:
2007 Dec 04
2
Multiple stacked barplots on the same graph?
Dear R-Users,
I would like to know whether it is possible to draw several
stacked barplots (i.e. side by side on the same sheet)...
my data look like :
Cond1 Cond1' Cond2 Cond2'
Compartment 1 11,81 2,05 12,49 0,70
Compartment 2 10,51 1,98 13,56 0,85
Compartment 3 1,95 0,63 2,81 0,22
Compartment 4 2,08 0,17
2010 Nov 29
1
cross tabulate variables by subject id
Dear list,
I have data like this:
dat1 <- data.frame(subject=rep(1:10,2),
cond1=rep(c("A","B"),each=5),
cond2=rep(c("C","D"),each=10),
choice=sample(0:1,10,replace=TRUE))
I would like to compare subjects' "choice" for (cond1=="A" &
cond2=="C") vs
2008 Aug 13
2
missing TRUE/FALSE error in conditional construct
Hi everyone,
I posted something similar to this in reply to another post, but there seems
to be a problem getting it onto the board, so I'm starting a new post.
I am trying to use conditional formatting to select non-zero and non-NaN
values from a matrix and pass them into another matrix. The problem is that
I keep encountering an error message indicating the ":missing value where
2017 Jul 24
5
Ifelse statements and combining columns
Hi everyone,
I'm having some trouble with my ifelse statements.
I'm trying to put 12 conditions within 3 groups. Here is the code I have so
far:
dat$cond <- ifelse(test = dat$cond == "cond1" | dat$cond == "cond2" |
dat$cond == "cond3" dat$cond == "cond4"
yes = "Uniform"
no = ifelse(test =
2017 May 22
5
[poison] is select-of-select to logic+select allowed?
Some InstCombine transforms for select-of-select were added here:
https://reviews.llvm.org/rL228409
But Alive says this is more poisonous:
Name: selsel
%s1 = select i1 %cond1, i8 C1, i8 C2
%s2 = select i1 %cond2, i8 %s1, i8 C2
=>
%andcond = and i1 %cond1, %cond2
%s2 = select i1 %andcond, i8 C1, i8 C2
http://rise4fun.com/Alive/JT6
Are those transforms legal?
-------------- next part
2015 Jul 16
3
[LLVMdev] why LoopUnswitch pass does not constant fold conditional branch and merge blocks
Hi,
I have a general question on LoopUnswtich pass.
Consider the following IR snippet:
define i32 @test(i1 %cond) {
br label %loop_begin
loop_begin:
br i1 %cond, label %loop_body, label %loop_exit
loop_body:
br label %do_something
do_something:
call void @some_func() noreturn nounwind
br label %loop_begin
loop_exit:
ret i32 0
}
declare void @some_func() noreturn
After running
2012 Sep 27
2
equivalent of Stata "by construct"
I am evaluating a switch from Stata to R. I don't need to extensive Statistical methods, but the main reason I am exploring the switch is the coding flexibility in R (e.g. Stata does not support linear/quadratic programming). I have been going over the R syntax and I had a quick question:
In Stata, one has a very useful construction called "by", e.g.
by month signal: gen xxx =
2011 May 22
2
Convert dataframe with two factors from wide to long format
I know how to convert a simple dataframe from wide to long format with one
varying factor. However, for a dataset with two factors like the following,
Subj T1_Cond1 T1_Cond2 T2_Cond1 T2_Cond2
1 0.125869 4.108232 1.099392 5.556614
2 1.427940 2.170026 0.120748 1.176353
How to elegantly convert to a long form as
Subj Time Cond Value
1 1 1 0.125869
1
2012 Mar 19
3
Issue with asin()
Hello everyone,
I am working for a few days already on a basic algorithm, very common in
applied agronomy, that aims to determine the degree-days necessary for a
given individual to reach a given growth stade. The algorithm (and context)
is explained here: http://www.oardc.ohio-state.edu/gdd/glossary.htm , and
so I implemented my function in R as follows:
DD <- function(Tmin, Tmax, Tseuil,
2002 Mar 04
2
Plotting a x axis from a vector with rownames
Hi all,
suppose there is a vector y with rownames:
> y
cond1 cond2 cond3 cond4
78.952 87.308 86.490 74.040
how can I easily plot this vector using the rownames? plot(y) gives me a
plot with a x-axis from 1 to 4 in 0.5 steps, also plot(rownames(y), y)
and plot(y ~ rownames(y) don't work. I know I can build a x-axis with
axis(1, ...), but in this case I need a character string like