Displaying 20 results from an estimated 7000 matches similar to: "help regarding functions & loops"
2006 Feb 16
2
fitting non-liner curves
Dear Sir/Madam,
I have two vectors say x<-c(0,0,2.73,3.42,3.95,4.26)
and y<-c(0.0,0.5,1.20,1.90,2.6,3.3). I want to fit y as a function of x and
get the equation.Do I have to use glm() ?
Rangesh
[[alternative HTML version deleted]]
2005 Aug 03
4
R CMD build error
Dear list,
I try to update the prabclus package.
R CMD check works nicely, no warnings, good results in all tests.
However, building the package fails:
ginkgo:/disk5/home/chrish/RAusw/libsrc R CMD build prabclus
* checking for file 'prabclus/DESCRIPTION' ... OK
* preparing 'prabclus':
* checking whether 'INDEX' is up-to-date ... OK
* removing junk files
* building
2005 Jul 27
3
fitting extreme value distribution
hi,
rgev function gives me random deviates and I have a data
set which I am fitting to an EVD,IS there a way I can plot
both observed and ideal evd on the same plot
thankyou
Rangesh
2006 Jul 16
2
Matrices given to pt? [was: [R] for loops and counters]
Hi, people.
I was a bit intrigued by the message quoted below. Indeed, if pt() is
given a matrix, it returns a matrix. Should this feature be documented?
?pt speaks about "a vector of quantiles", and says nothing about the
type of what it returns.
The same might presumably apply to other distribution-related functions.
----- Forwarded message from Martyn Plummer <plummer at
1999 Oct 05
2
for loops and counters
I am trying to assign values to a vector (pvalue). Similar code works in C
but not in R. What am I doing wrong?
r <- pvalue <- 0
for(i in (1:(k-1))){
for(j in (i+1):k){
r <- r+1
tstat <- (means[i]-means[j])/rms
pvalue[r] <- 2*(1-pt(abs(tstat),df))
}
}
Thank you.
Peter B.
--
Peter B. Mandeville mandevip at deimos.tc.uaslp.mx
Jefe del
2009 Sep 27
2
Check value interval in a if loop
Hi R community
I have a little problem, and I tried to solve it by myself but I couldn't. I building an if loop, and I want to check a value inside an interval. This would be the case:
pvalue=0,2999
if(pvalue>0.05 or pvalue<0.1)
as you can see I would like to check in that if loop if my pvalue is inside of that interval(from 0.05 to 0.1), and I tried these options:
if(pvalue>0.05
2013 Mar 13
1
multi-comparison of means
Hi all:
I have a question about multi-comparison.
The data is in the attachment.
My purpose:
Compare the predicted means of the 3 methods(a,b,c) pairwisely.
I have 3 ideas:
#idea1
result_aov<-aov(y~ method + x1 + x2)
TukeyHSD(result_aov)
diff lwr upr p adj
b-a 0.845 0.5861098 1.1038902 0.0000001
c-a 0.790 0.5311098 1.0488902 0.0000002
c-b -0.055 -0.3138902
2011 Mar 29
2
List extraction
I have created a list of tables with the same columns but different number of
row.
Example (actual list has ~200 elements):
> temp1<- data.frame(ID=c("Herb","Shrub"),stat=c(4,5),pvalue=c(.03,.04))
> temp2<- data.frame(ID=c("Herb","Shrub",
> "Tree"),stat=c(12,15,13),pvalue=c(.2,0.4,.3))
> L<-list(a=temp1,b=temp2)
> L
$a
2007 Jul 07
1
Minor bug in lillie.test from nortest package (PR#9784)
Full_Name: David Sterling
Version: 2.4.0
OS: OS X
Submission from: (NULL) (64.81.102.199)
lillie.test() dies without grace producing the error message: 'Error in if
(pvalue > 0.1) { : missing value where TRUE/FALSE needed' when passed a vector
of identical values.
Examples:
> lillie.test(c(0,0,0,0,0,0,0,0,0,0))
Error in if (pvalue > 0.1) { : missing value where TRUE/FALSE
2006 Nov 08
2
interprete wilcox.test results
Dear All,
I am using wilcox.test to test two samples, data_a and data_b, earch sample has 3 replicates, suppose data_a and data_b are 20*3 matrix. Then I used the following to test the null hypothesis (they are from same distribution.):
wilcox.test(x=data_a, y=data_b, alternative="g")
I got pvalue = 1.90806170863311e-09.
When I switched data_a and data_b by doing the following:
2007 Jun 11
1
epitools and R 2.5
At work after updating to R 2.5 I get an error using epitab from package
epitools, when at home (R 2.4) I get no error. Could someone help me?
Thanks
Pietro Bulian
Servizio di Onco-Ematologia Clinico-Sperimentale
I.R.C.C.S. Centro di Riferimento Oncologico
Via Franco Gallini 2
33081 Aviano (PN) - Italy
phone: +39 0434 659 412
fax: +39 0434 659 409
e-mail: pbulian at cro.it
(at work)
2009 Jan 04
1
Lattice xyplot help please.
Hi -
I am not R expert and I would appreciate your time if you can help me
about my xyplot question.
I would like to add text (p-value) in a 4 panels xyplot. I thought
panel = function{} should work but I am not sure where I did it wrong.
The error message from the following code is
"Argument subscripts is missing with no default values"
xyplot(GLG ~ PD | factor(TRT) , groups =
2007 Dec 31
2
help on ROC analysis
Dear all,
Some functions like 'ROC(Epi)' can be used to perform ROC analyssi, but it
needs us to specify the fitting model in the argument. Now i have got the
predicted p-values (0,1) for the 0/1 response variable using some other
approach, see the following example dataset:
id mark predict.pvalue
1 1 0.927
2 0 0.928
3 1 0.928
..................
2010 Feb 24
1
extracting results from wilcox_test (package::coin)
Recently, I ran a series of Kruskal-Wallace tests [kruskal.test()] using by()
to group by site Output is a list:
>Herb.KW
Herb.df$ID: 10-1
Kruskal-Wallis rank sum test
data: Indicator_Rating by Year
Kruskal-Wallis chi-squared = 15.24, df = 7, p-value = 0.03302
-----------------------------------------------------------------------------------------------------
Herb.df$ID: 18-1
2017 Jun 29
3
Help : glm p-values for a factor predictor
Hello,
i am a newby on R and i am trying to make a backward selection on a
binomial-logit glm on a large dataset (69000 lines for 145 predictors).
After 3 days working, the stepAIC function did not terminate. I do not
know if that is normal but i would like to try computing a "homemade"
backward with a repeated glm ; at each step, the predictor with the max
pvalue would be
2009 Jul 28
2
formatting in r
Hello,
I have output that I want to print out. I am having a few issues.
1] output u to power is really nothing more than a 2 x 11 set of values
formed using cbind function
and printed out as a data frame
How can I get it to output over several lines such as seen here?
2] Critical Z etc. were added by hand. I need an example of how I can
mix alphanumeric
and numeric data on
2011 Aug 01
1
Write.table Question
Hi,
I'm trying to create an abbreviated data file from a larger version. I can
use the subset command to create a value for this data:
dat <-subset(raw.data, select=c(SNP, Pvalue))
> head (dat)
SNP Pvalue
1 rs11 0.6516
2 rs12 0.3311
3 rs13 0.5615
but when I try to write.table using:
write.table (dat, file = "/path/to/my/data.txt", sep = " ",
2017 Jun 29
0
Help : glm p-values for a factor predictor
It might help if you provided the code you used. It's possible that
you didn't use direction="backward" in stepAIC(). Or if you did, it
was still running, so whatever else you try will still be slow. The
statement "R provides only the pvalues for each level" is wrong: look
at the anova() function.
Bob
On 29 June 2017 at 11:13, Beno?t PELE <benoit.pele at
2006 Oct 25
1
density plot text
Is there any way of adding text to a density plot? I have had a go using the
text() function but I think the error is because this function doesn't work
with densityplot().
Alternatively, I understand I can achieve pretty much the same result if I
plot a density kernel estimate using plot() (which allows text()), but I do
prefer densityplot().
Also, is it possible to specify the dimensions
2005 Apr 20
1
negative p-values from fisher's test (PR#7801)
Full_Name: Martha Nason
Version: 2.0.1
OS: Windows XP
Submission from: (NULL) (137.187.154.154)
I am running simulations using fisher's test on 2 x c tables and a very small
p.value from fisher's test (<2.2e-16) is returned as a negative number. Code
follows.
> set.seed(0)
> nreps.outer <-7
> pvalue.fisher <- rep(NA,nreps.outer)
>
> population1 <- c(