Displaying 20 results from an estimated 20000 matches similar to: "Something wrong with my function Please Help"
2009 Sep 08
2
strange results in summary and IQR functions
Dear R users,
Something is strange in summary and IQR. Suppose, I have a data set and I
would like to find the Q1, Q2, Q3 and IQR.
x<-c(2,4,11,12,13,15,31,31,37,47)
> summary(x)
Min. 1st Qu. Median Mean 3rd Qu. Max.
2.00 11.25 14.00 20.30 31.00 47.00
> IQR(x)
[1] 19.75
However, I test the same data set in SAS "proc univariate", and SAS shows
that
2010 Feb 23
3
Use 2 "ifelse" to sort data
Dear R users,
I have a question how to use 2 "ifelse" to sort my data. Such as
from 11 to 20 assign to A; 6 to 10 assign to B, and the rest of them assign
to C
a<-1:20
tt<-ifelse(a>10, "A",no=ifelse( 5< a <=10, "B", "C"))
Many Thanks
Chunhao
--
View this message in context:
2009 Jun 12
1
Please Help pairwise.t.test!!
Hi R users,
My question is, If I have 3 groups, A, B, C and I know mean of A =20, B=21,
and C=20.5 and I also know the
standard error of A =1.1, B=2.2, C=3.2. Plus, I know A has 30 observations,
B has 78, C has 45. But I do not have the raw data.
Can I use pairwise.t.test to conduct a Bonferroni test? If yes, Could you
give me a hint?
Thank you so much
Chunhao
--
View this message in
2008 Jul 30
2
Repeated Measure ANOVA-Old question
Hi R users,
I google the website and I found that there are three ways to perform
repeated measure ANOVA: aov, lme and lmer.
http://www.mail-archive.com/r-help at stat.math.ethz.ch/msg58502.html
But the questions are which one is good to use and how to do post-hoc test?
I use the example that is provided in the above link and I try
> tt<-aov(p.pa~group*time+Error(subject/time),data=P.PA)
2011 Sep 09
4
Very simple question about list components
I have a list 'ans' from the following code:
tt <- rnorm(50)
rr <- rnorm(50)
ans <- lm(rr~tt)
ans[1] is "$coefficients", ans[2] is "$residuals", ans[3] is
"$effects", ... and so on up to ans[12]. Is there an easy way to
display just these names and not the data they contain? I thought I
saw my advisor type "ans$" and they were displayed,
2005 Jul 28
1
Unexpected behavior in recode{car}
Thanks to the R creators for such a great statistical system. Thanks to
the R help list, I have (finally) gotten far enough in R to have a
question I hope to be worth posting.
I'm using the recode function from John Fox's car package and have
encountered some unexpected behavior.
Consider the following example:
## Begin cut-and-paste example
require( car )
set.seed(12345)
nn <-
2007 Jan 02
4
Am I missing something about debugging?
I would like to be able to trace execution into calls below the current
function, or to follow execution as calls return. This is roughly the
distinction between "step" and "next" in many debuggers.
I would also like to be able to switch to a location further up the call
stack than the location at which I enter the debugger, to see the
context of the current operations.
Are
2004 Jul 14
2
tracing something in a namespace (PR#7091)
# Your mailer is set to "none" (default on Windows),
# hence we cannot send the bug report directly from R.
# Please copy the bug report (after finishing it) to
# your favorite email program and send it to
#
# r-bugs@r-project.org
#
######################################################
> x <- rnorm(10)
> y <- 1:10
> xyplot(y ~ x)
>
2011 Apr 11
1
forest + igraph ?
Hello,
Is it possible to have two meta-plots in one graph (not par(mfrow=c(2,1))? But somthing like
library(metafor)
library("igraph")
if (interactive()) {
forest(dat.Treat$RR, ci.lb=dat.Treat$lower, ci.ub=dat.Treat$upper, xlab="Relative Risk",slab=dat.Treat$ID,refline=1)
forest(dat.Control$RR, ci.lb=dat.Control$lower, ci.ub=dat.Control$upper, xlab="Relative
2006 Nov 10
3
Confidence interval for relative risk
The concrete problem is that I am refereeing
a paper where a confidence interval is
presented for the risk ratio and I do not find
it credible. I show below my attempts to
do this in R. The example is slightly changed
from the authors'.
I can obtain a confidence interval for
the odds ratio from fisher.test of
course
=== fisher.test example ===
> outcome <- matrix(c(500, 0, 500, 8),
2007 Oct 31
4
PRI over T1 calls dropping, cause 100
I have a T1 link from asterisk 1.2.23 (also tried with 1.4.13) to a Meridian
Option 61C. Calls either way drop with error "Channel 0/23, span 1 got
hangup, cause 100". Can anyone offer insight into the cause and
solution/workaround? (I tried upgrading to Ast 1.4.13, and upgrading
matching zaptel & libpri, put the problem is identical).
For testing, I tried a call from the
2011 Mar 15
3
Reporting odds ratios or risk ratios from GLM
I am a new R user (am using it through the Rcmdr package) and have struggled
to find out how to report OR and RR directly when running GLM models (not
only reporting coefficients.)
Example of the syntax that I have used:
GLM.2 <- glm(diarsev ~ treatmentarm +childage +breastfed,
family=binomial(logit), data=fieldtrials2)
summary(GLM.2)
This works well except that I manually have to calculate
2010 Oct 29
2
how to debug (mtrace) a function defined inside a function?
Hi, everyone. I am using a fair amount of closures in my code. Problem i am
experiencing is i cannot figure out how to mtrace functions defined within a
function. There must be some way to name such function for mtrace to see it
and let me step into it. For example, say i have code
mymodel<-function(){
data<-numeric(0)
build<-function(){
data<<-1
}
m<-list()
2004 Jun 07
1
freebsd-security Digest, Vol 61, Issue 3
On Sat, 29 May 2004 12:00:52 -0700 (PDT),
<freebsd-security-request@freebsd.org> wrote:
Hello !
Today i see in snort logs :
[**] [1:528:4] BAD-TRAFFIC loopback traffic [**]
[Classification: Potentially Bad Traffic] [Priority: 2]
06/07-09:44:39.044590 127.0.0.1:80 -> 10.6.148.173:1566
TCP TTL:128 TOS:0x0 ID:577 IpLen:20 DgmLen:40
***A*R** Seq: 0x0 Ack: 0x75830001 Win: 0x0 TcpLen:
2009 Jan 28
3
for/if loop
Hi, it's my first time to write a loop with R for my homework. This loop is
part of the function. I wanna assign values for hll according to panel
[ii,1]=pp. I didn't get any error message in this part. but then when I
further calculate another stuff with hll, the function can't return. I think
it must be some problem in my loop. Probably something stupid or easy. But I
tried to look
2013 Apr 25
1
time series plot: x-axis problem
Hi,
I'm trying to plot a simple time series. I'm running into an issue with
x-axis
The codes below will produce a plot with correct x-axis showing from Jan to
Dec
> rr=c(3,2,4,5,4,5,3,3,6,2,4,2)
> (rr=ts(rr,start=c(2012,1),frequency=12))
> win.graph(width=6.5, height=2.5,pointsize=8)
> plot(rr, xlab="2012", ylab="event freq", xaxt = "n",
2010 Apr 19
2
plotting RR, 95% CI as table and figure in same plot
Hi all--
I am in the process of helping colleagues write up a ms in which we fit
zero-inflated Poisson models. I would prefer plotting the rate ratios
and 95% CI (as I've found Gelman and others convincing about plotting
tables...), but our journals usually like the numbers themselves.
Thus, I'm looking at a recent JAMA article in which both numbers and
dotplot of RR and 95% CI are
2010 Jun 08
2
problem with if else statement
Dear colleagues,
What did I not understand ?
->my intention
I want to create a new variable:
In plain language:
If someone is taking anithypertensive treatment (med.hyper==1)
table(med.hyper)
med.hyper
0 1
472 97
I want to subtract 5 mmHg (rr.dia.2m-5) from the measured diastolic
blood pressure (rr.dia.2m)
if not treated - the value of the measured diastolic blood pressure
should
2011 May 05
2
quick question : interpolating file name in pipe command
Hi Guys
I am trying to read a bunch of files in the loop but pipe function
which I use to cut few columns is somehow unable to interpolate the
file variable.
eg:
> file="check.txt"
> data <- read.table(pipe("cut -f 2,3 file"), sep="\t", col.names=c('pos','cov') )
cut: file: No such file or directory
how can I pass variable file to pipe
2011 Apr 07
2
How to debug reference classes?
How do you debug methods of a reference class? I've been using mtrace, which
is excellent, but i cannot figure out how to mtrace a reference class
method. Maybe there is some other way to debug these, for example with
ordinary trace? for now i am only able to use options(error=recover), which
is not giving me idea where exactly in the code i am once i am stopped on an
error.
--
View this