similar to: if statement problem

Displaying 20 results from an estimated 900 matches similar to: "if statement problem"

2006 Sep 27
3
Converting text to numbers
Hi, I have Forecast Class and Observed Class in a data matrix as below. > Sample1 FCT OBS 1 1 5 2 2 4 3 3- 3+ 4 3 3 5 3+ 3- 6 4 2 7 5 1 I want to find the difference between Observed and Forecast Classes. How can I get this done? I tried to following to convert the 1 through 5 classes, to 1 through 7 for both OBS and FCT column. > Sample1$OBS2 <- Sample1$OBS
2002 Oct 17
1
manova with Error?
Let's say I have a within-subject experiment with 2 observables, obs1 and ob2 and 2 independent factors, fac1 and fac2. I can do summary( aov( obs1~fac1*fac2 + Error(Subject/(fac1*fac2)) ) ) summary( aov( obs2~fac1*fac2 + Error(Subject/(fac1*fac2)) ) ) to test the 2 observables separately. > summary( fit<-manova( cbind(obs1,obs2)~fac1*fac2 + Error(Subject/(fac1*fac2)) ) ) gives
2009 Oct 19
2
Filtering on a dataframe- newbie question
Hi, newbie question. I have a data-frame with 3 named columns: Name, Obs1, Obs2. The Name column members are made of alphanumeric characters: T1, T2, T3 etc. I would like to acess only that subset of the data-frame with Name == T44. X <- dataframe[dataframe$Name=='T44'] does not work. Any ideas on how to do this? I'm sure I'm missing a simple concept here. Thanks, Anjan --
2010 Jan 18
1
problem of data manipulation
Hello, See my problem below. a<-data.frame(c("s","c","c","n","n","n"),c(rep(1,3),rep(2,3)),c(rep(2,3),rep(1,3)),c("01/01/1999","10/02/2000","13/02/2000","11/02/2000","15/02/2000","23/02/2000"))
2006 Mar 14
1
Interpolate univariate data on regular 3D grid to new 3D grid
Dear R Users, I have some data that is very similar in form to a 3D image - ie univariate data on a regular 3D grid. I keep this as a 3D numeric array in R with attributes describing the sampling points along the 3 dimensions. I would like to interpolate this onto a new regular 3D grid that I specify (eg by supplying 3 vectors corresponding to the new grid locations on each of the 3
2009 Jun 15
1
expand data
hi, all I inherited a data set with format like the following: para.A para.B para.C observation.1 observation.2 observation.3 .... Essentially, the same experiment (with same parameters) are conducted 3 times, with corresponding observations. What are the efficient ways of re-arranging this data set in a one row per observation such that: para.A para.B para.C observation.1 para.A
2012 Feb 20
2
overlay of two sets of boxplots
Hello, I am new to R and currently have the following problem: I have successfully loaded my data in R which consists of two numeric columns (LI_F and female) and one character column (Strain). So far I can plot two different set of boxplots for each of the numeric columns plotted by the groups of the character column and the commands look like that: boxplot(LI_F~Strain, ylab="LI_F",
2006 Oct 18
6
new R-user needs help
Dear all, I have a dataset Exp name id x1 x2 x3 x4 x5 1 a 1 23 24 23 22 30 1 b 2 25 26 27 23 24 1 c 3 32 19 23 25 28 2 a 4 28 32 24 26 27 2 b 5 23 24 25 26 28 2 c 6 23 31 30 38 23 3 a 7 24 25 31 27 29 3 b 8 28 25 26 32 28 3 c 9 21 31 28 23 29 where each name a,b and c is repeated three times. Now I want to calculate the the averages of
2006 Feb 23
2
Strange p-level for the fixed effect with lme function
Hello, I ran two lme analyses and got expected results. However, I saw something suspicious regarding p-level for fixed effect. Models are the same, only experimental designs differ and, of course, subjects. I am aware that I could done nesting Subjects within Experiments, but it is expected to have much slower RT (reaction time) in the second experiment, since the task is more complex, so it
2009 Jun 08
2
ridiculous behaviour printing to eps: labels all messed up!
OK, this is really weird! here's an example code: t1<-c(1,2,3,4) t2<-c(4,2,4,2) plot(t1~t2, xlab="exp1", ylab="exp2") dev.copy2eps(file="test.eps") that all seems fine... until you look at the eps file created, where for some weird reason, if you scroll down to the end, the code reads: /Font1 findfont 12 s 0 setgray 214.02 18.72 (e) 0 ta -0.360 (xp1) tb
2011 May 31
2
Files are duplicated after renaming (with glusterfs+zfs-fuse)
Hi all, I installed glusterfs (version 3.1.3) with zfs-fuse (0.6.9) as the underlying filesystem. After renaming a file, I found the file duplicated. Following is my test scenario. root at ubuntu:/# zpool create tank /dev/sdb root at ubuntu:/# gluster volume create test-volume ubuntu:/tank/exp1 ubuntu:/exp2 root at ubuntu:/# gluster volume start test-volume root at ubuntu:/# mount -t glusterfs
2009 Feb 24
2
[LLVMdev] Detecting counted loops
I need to be able to detect a well-behaved loop. (i.e one where exp1 assigns a value to an int i, exp2 compares i with a loop constant, exp3 adjusts i by a loop constant, and the inner block has no assignments to i.) I need this because in Sun's Java VM garbage collection only takes place at safepoints, so a potentially unbounded loop must call safepoint() some time. However, safepoints are
2006 Apr 20
2
nlminb( ) : one compartment open PK model
All, I have been able to successfully use the optim( ) function with "L-BFGS-B" to find reasonable parameters for a one-compartment open pharmacokinetic model. My loss function in this case was squared error, and I made no assumptions about the distribution of the plasma values. The model appeared to fit pretty well. Out of curiosity, I decided to try to use nlminb( ) applied to a
2012 Nov 06
2
I am very confused about strip Stripe what way it hold space?
I have 4 dell 2970 server , three server harddisk is 146Gx6 ,one hard disk is 72Gx6: each server mount info is /dev/sda4 on /exp1 type xfs (rw) /dev/sdb1 on /exp2 type xfs (rw) /dev/sdc1 on /exp3 type xfs (rw) /dev/sdd1 on /exp4 type xfs (rw) /dev/sde1 on /exp5 type xfs (rw) /dev/sdf1 on /exp6 type xfs (rw) I create a gluster volume have 4 stripe gluster volume create test-volume3 stripe 4
2012 Jun 24
2
Defining multiple variables in a loop
Good day, For lack of a better solution (or perhaps I am ignorant to something more elegant), I have been bootstrapping panel data by hand so to speak and I would like to know if there is a way to define multiple variables in a loop using the loop variable. I found a post (here: https://stat.ethz.ch/pipermail/r-help/2002-October/026305.html ) that discussed naming multiple variables but it
2001 Sep 13
1
row-wise dataframe calculation
Hi, i have a dataframe such as: Exp1 Exp2 Exp3 name1 12.6 78.0 45.6 name2 11.9 19.0 21.0 name3 10.0 14.0 17.0 ... ... ... Real datasets might be quite large - 20,000 rows by 100 columns I want to calculate metrics such as the variation *row-wise*. So, var for name1, var for name 2, var for name3 etc. Can someone kindly guide me on how best to code this? Also, once such a metric has
2009 Aug 07
3
Simple Question: adding points to a boxplot
I apologize in advance for the simplicity of this question. I use R 2-3 times a year, and I seem to forget more in the intervening months than I learn during my days of panicked reading.... I HAVE tried looking at the help resources; I'm just not very good at understanding them. I have a dataframe with 18 observations of 5 different things, and a second dataframe with and estimate for those
2011 Feb 12
2
Test for equivalence
Hi! is there a way in R to check whether the outcome of two different experiments is statistically distinguishable or indistinguishable? More preciously, I used the wilcoxon test to determine the differences between controls and treated subjects for two different experiments. Now I would like to check whether the two lists of analytes obtained are statistically distinguishable or
2011 May 21
0
Problem with ANOVA repeated measures: "Error() model is singular"
Hello everybody, I need an help because I donĀ“t know if the command for the ANOVA analysis I am performing in R is correct. Indeed using the function aov I get the following error:"In aov (......) Error() model is singular" The structure of my table is the following: subject, stimulus, condition, sex, response Example: subject stimulus condition sex response
2012 Feb 20
0
repeating or looping within an apply statement to handle multiple variables
Dear R experts, I would like to please ask for your help with repeating steps in an apply statement. I have a dataframe that lists multiple variables for a given id and visit, as well as drug treatment. > head(exp) id visit variable1 variable2 variable3 variable4 drug 1 3 1 13 10 7 11 0 2 3 5 10 15 9 9 0 3 3 12