similar to: t.test inside function (PR#373)

Displaying 20 results from an estimated 10000 matches similar to: "t.test inside function (PR#373)"

2003 Feb 11
1
mean function on correlation matrices (PR#2540)
Full_Name: Raymond Salvador Version: R 1.6.2 OS: Windows ME Submission from: (NULL) (131.111.93.195) The mean function applied on individual components of several correlation matrices gives a wrong result (gives the first value instead of the mean). Here there is a simple example x1 <- rnorm(10,1,1) y1 <- rnorm(10,1,1) z1 <- cbind(x1,y1) w1 <- cor(z1) x2 <- rnorm(10,1,1) y2
2000 Oct 17
1
filed plot symbols
This example, x<-1:10 y1<-x y2<-x+2 plot(x,y1,pch=21,ylim=range(c(y1,y2)),type="o",lty="solid",bg="white") points(x,y2,pch=22,type="o",lty="dashed",bg="white") legend(7,3,legend=c("y1","y2"),pch=c(21,22),lty=c("solid","dashed"),bg="white") works if I use pch = one of 21-25. But
2010 Feb 11
2
Find each time a value changes
Dear List, I am trying to find each time a value changes in a dataset. The numbers are variables for day vs. night values, so what I am really getting is the daily sunrise and sunset. A simplified example is the following: x<-seq(1:100) y1<-rep(1,10) y2<-rep(2,10) y<-c(y1,y2,y1,y1,y1,y2,y1,y2,y1,y2) xy<-cbind(x,y) I would like to know each time the numbers change. Correct
2006 Aug 06
2
paired t-test. Need to rearrange data?
Dear all, I have received some data arranged like this: # original data id <- rep(letters[1:6], each=2) time <- as.factor(rep(1:2, 6)) y <- as.vector(replicate(6, c(rnorm(n=1, mean=1), rnorm(n=1, mean=2)))) test.data <- data.frame(id, time, y) test.data I would like to perform a paired t-test of the y-values at time=1 against those at time=2, with samples paired by their id. Is it
2002 Dec 17
3
Changing "..." inside a function: impossible? desirable?
This is was something like a request for your comments, thoughts on the topic... Many of you will know that the "..." (aka \dots) argument is very useful for passing ``further graphical parameters'', but can be a pain when itself is passed to too many plotting functions inside your own function. An artificial example being myplot <- function(x,y, ...) { plot(0:1, 0:1,
2012 Jan 12
2
Points inside a polygon
I have a list of bounds for a series of polygons. I do understand the formula to determine whether point i is within polygon X (X[x1] < i[x] & X[x2] > i[x] & X[y1] < i[y] & X[y2] > i[y]), and I can apply this throughout the dataset. However, this naive algorithm doesn't scale very well. The data set contains 10,000 points consisting of (n,e) pairs where I'm
1999 Nov 10
1
plot() bugs (PR#317)
Full_Name: Bill Simpson Version: 65.1 OS: Linux Redhat 6.1 Submission from: (NULL) (193.62.250.209) Try this: #default plot symbols and lettering are too small, need to scale up par(cex=2,mex=.7) par(mar=c(5,5,1,1)) spdiff<-c(1,2,3,4,5) dpdet<-c(1,2,3,4,5)/10 dpsp<-c(2,3,4,5,6)/10 dpdir<-c(2,4,6,8,10)/10 plot(spdiff,dpdet,pch=15,ylim=c(0,max(dpdet,dpsp,dpdir)),xlab="Speed
2007 Dec 05
2
Interpretation of 'Intercept' in a 2-way factorial lm
Hi all, I hope this question is not too trivial. I can't find an explanation anywhere (Stats and R books, R-archives) so now I have to turn to the R-list. Question: If you have a factorial design with two factors (say A and B with two levels each). What does the intercept coefficient with treatment.contrasts represent?? Here is an example without interaction where A has two levels A1 and
2000 Mar 21
5
par help wrong: xlog & ylog (PR#497)
Full_Name: Version: 1.0.0 OS: linux Submission from: (NULL) (193.62.250.209) ?par lists and describes xlog and ylog, though these are obsolete. It does not list log. I found out about log from ?plot.defaults--so that help is OK. -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send
2006 Feb 08
1
bwplot: how to display response variables separately in same panel?
Hi - I have two response variables 'y1' and 'y2' and a factor 'x'. I would like to create paired box-whiskers plots for y1~x and y2~x and labeled for the same x. the b-w plots would be side-by-side in the same panel - almost like a barchart with two parallel columns for the same x. the code 'bwplot(y1+y2~x, outer=T)' gives me two side-by-side panels. this is ok,
2012 Aug 15
1
shade overlapping portions of circles (or other shapes)
I'm making some illustrations and it would be convenient to automatically shade the overlapping portions of circles. These illustrations are for Social Choice theory, a field in political science and economics. I've wrestled together some examples so you can see what I mean, but have not mastered the "color overlapping sections" problem (as you will see):
2009 Jan 19
1
R bug or ghostscript bug or my bug?
Dear R developers: The following R program produces a pdf file that does not survive ghostscript distillation correctly. The undistilled version is at http://welch.econ.brown.edu/temp/try.PDF while the distilled version is at http://welch.econ.brown.edu/temp/try.pdf . When previewed, the points are wrong in the distilled .pdf version, but only in one of the two points invokations (huh?) . The
2011 Feb 27
3
accessing variables inside a function, inside a loop
dear list! I KNOW this has been answered a million times before. But, as some might remember from their "freelance" times as a statistic consultant, sometimes you're blinded by the facts. I KNOW I have seen this problem solved, but due to the mental blockade i have been suffering from the last 3 hours, I can neither find the answer on the mailing list nor on google. I wrote a
2013 Mar 17
3
help with simple function
hello all I am writing a quite simple script to study dental wear patterns in humans and I wrote this function sqrt(var(Y1)+var(Y2))^2-4(var(Y1)*(var(Y2)-cov(Y1,Y2)^2)) but appear this error message Error: attempt to apply non-function alternatively I wrote this sqrt(var(Y1)+var(Y2)^2)-4[(var(Y1)*(var(Y2)-cov(Y1,Y2)^2))] but this error message appear [1] NA Warning message: NAs introduced
2008 Jan 29
3
How to get two y-axises in a bar plot?
Hi, I have measured two response variables (y1, y2) at each treatment level (x = 0, 1.5 or 3). Now I would like to show the y1 and y2 against x in a bar plot. However, y1 and y2 differ in scale so I need two y-axises, one on the left side and one on the right side (and I dont want to standardize my responses). This is fairly easy if you want to show points,lines etc, but gets more complicated
2008 Feb 27
4
plot y1 and y2 on one graph
Dear all I have a code like x<-1:10 y1<-x+runif(10)*2 y2<-seq(0,50,length.out=10)+rnorm(10)*10 par(mfrow=c(1,2)) plot(y1~x) plot(y2~x) Now I would like to plot y1 and y2 on the same graph, with its two scales (y1 on left and y2 on rigth side). Any help are welcome. Kind regards Miltinho Brazil [[alternative HTML version deleted]]
2008 Jan 13
2
{worker} after :end-time worker freaks out
Hi all, i was using bdrb a while ago and it wasn''t stable enough in version 0.2.1 for doing the job - it loss jobs or did execute only the first one invoked and so on. Now i gave the new version a try and i found a bug at playing around. When i start a worker_method over the normal Unix scheduler bdrb will start as much as possible the worker_method after the :end-time is reached.
2013 Apr 08
3
Reshaping a table
Hello all, I have data in the form of a table: X Y1 Y2 0.1 3 2 0.2 2 1 And I would like to transform in the form: X Y 0.1 Y1 0.1 Y1 0.1 Y1 0.1 Y2 0.1 Y2 0.2 Y1 0.2 Y1 0.2 Y2 Any ideas how? Thanks in advance, IOanna [[alternative HTML version deleted]]
2003 Mar 04
4
writing several command line in R console
Hi R lovers I would like to know how to step to the next line in the R console editor without breaking the continuity of my code more clearly : if for example I write a function, so far i have to write the all code inside on the same line wich may become obscure as the function is more and more complex. I would like to do like in the example of the manuels: >twosam <- function(y1, y2) {
2011 Jan 19
2
Reshape
Hi - I'm up against a complicated reshape problem. I have data of the form X1,Y1,hr1,hr2,hr3 X1,Y2,hr1,hr2,hr3 X1,Y3,hr1,hr2,hr3 X2,Y1,hr1,hr2,hr3 X2,Y2,hr1,hr2,hr3 X2,Y3,hr1,hr2,hr3 where X and Y are factors and the hr(1,2,3) are values. I need it as ,X1, X2 Y1,hr1,hr1 Y1,hr2,hr2 Y1,hr3,hr3 Y2,hr1,hr1 Y2,hr2,hr2 Y2,hr3,hr3 .., Any hints? I've been at it for hours. p -- View