Dear R-help,
Â
Chi Square Test for Goodness of Fit
Â
Â
Problem Faced :
Â
I have got a discrete data
as given below (R script)
Â
No_of_Frauds <-c
1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,2,1,2,2,2,1,1,2,1,1,1,1,4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,5,1,2,1,1,1,1,1,1,1
Soren,
It sounds like you are new to R so I will refer you to some packages that I
think some people would find more user friendly as beginners.
Zelig is excellent. You could run a series of logistic regressions coding your
dependent variables as follows (a versus b, a versus c, b versus c)
one more question,
"The third value (kappa (2*PA-1)) is adjusted for prevalence using the
method proposed by Byrt, Bishop and Carlin (1993)" --- from ?cohen.kappa
What does the "prevalence" refer to?
On Sun, Sep 7, 2008 at 10:43 PM, Weiwei Shi <[EMAIL PROTECTED]> wrote:
> Dear all,
>
> I have a
I'm not sure I exactly understand your problem, but if you are
looking for a recursive algorithm for calculating the average by
addition of one record only at a time, consider:
y[k] = y[k-1] + (x[k] - y[k-1])/k, where y(0) = 0, k = 1, 2, ...
At each stage, y[k] = (x[1]+...+x[k])/k.
At 0
Dear Srini,
Here is one way:
# Data set
x=read.table(textConnection("fruit weight
1 apple1.3
2 apple1.5
3 apple1.6
4 orange1.4
5 orange1.6"),header=TRUE)
x[tapply(x$weight,x$fruit,which.max),]
apple orange
1.61.6
or
Try also
x[cumsum(tapply(x$weight,x$fruit,whic
dear group,
i have a data matrix with some replicate items with different values. I want to
extract the row with max value.
for example:
> x
fruit weight
1 apple1.3
2 apple1.5
3 apple1.6
4 orange1.4
5 orange1.6
x is a data frame.
I want to extract unique items from
Dear Thomas Lumley:
According to your suggestion I have sorted the 'newdata' by id. When I print
the results the error was still there. So I tried to sort the 'newdata' by y,
x although I don't think it make sense. The error was still there. Here it
was the part of the code:
data1=newdata[
I have a nested ANOVA, with a fixed factor "tmt" nested within "site" (random).
There are missing values in the data set.
aeucs, tmt and site have been defined as objects
I have tried:
model1=lme(aeucs~tmt,random=~1|tmt/site)
I get the following error message
Error in na.fail.default(list(aeuc
Hi R users
Is there any example for nonlinear parametric boot? I google it but I
can't find it. I am interested in the parameter estimators of a
nonlinear model. But I really don't know how to code it in the
"ran.gen" statement (data set from ?nls)
fm1 <- nls(weight ~ Asym/(1+exp((xmid-Ti
Emmanuel Charpentier wrote:
Dear list,
I have to read a not-so-small bunch of not-so-small Excel files, which
seem to have traversed Window 3.1, Windows95 and Windows NT versions of
the thing (with maybe a Mac or two thrown in for good measure...).
The problem is that 1) I need to read
On 07/09/2008 4:51 PM, Edna Bell wrote:
Dear R Gurus:
How would I create a vignette, please?
Why would a vignette be better than examples, please?
You can create a vignette any way you like, but the most common way is
with Sweave: write a document that is mainly LaTeX, but with R code
incl
From the gee() help page:
Data are assumed to be sorted so that observations
on a cluster are contiguous rows for all entities in the formula.
-thomas
On Sun, 7 Sep 2008, Qinglin Wu wrote:
Dear List:
I found an error when I called the 'gee' function. I cannot solve and explain
it
Dear list,
I have to read a not-so-small bunch of not-so-small Excel files, which
seem to have traversed Window 3.1, Windows95 and Windows NT versions of
the thing (with maybe a Mac or two thrown in for good measure...).
The problem is that 1) I need to read strings, and 2) those
string
Hi,
I am at the end of my wit to figure out how to run the optim function on
a list.
Basically, I have a data set of three columns as "Site", "Pool" and
"Positivity" ( the full data set is copied at the end). I want to run
the maximal likelihood estimation separately on subsets split by "Si
Try this:
> # read in data ensuring NAME is character, not factor
> Lines <- " CODE NAME
+ 13 aaa
+ 23 aab
+ 33 aac
+ 44 bba
+ 54 bbb
+ 64 bbc
+ 74 bbd
+ 85 cca
+ 95 ccb
+ "
> DF <- read.table(textConnection(Lines), header = TRUE, as.is = TRUE)
>
> DF$s
2008/9/7 Anny Huang <[EMAIL PROTECTED]>:
> Hello,
>
> I want to know how to draw a line connecting each point to the x-axis
> perpendicularly (i.e. a vertical line).
> abline(v=...) seems not to work for my purpose, because it runs over the
> data point. Can anyone help? Thanks.
>
If your x-axis
Hello
I am a newbie. I had my R upgraded from 2.7.1 to 2.7.2 and in doing so I
decided to install all 2.7 versions under c:\program files\R\2.7 from now
on (2.7.1 is located under .\2.7.1)
Although I don't like the idea (I am running Vista), I have edited
etc\Renviron.site to contain:
R_USER=
Here is a way to do it by reading in 60 lines at a time and computing the means:
# create some test data
n <- 360
x <- matrix(runif(360*16800), nrow=16800)
cat(x, file="/tempxx.txt")
# now process the data 60 lines at a time, averaging each 60x60 block
result <- matrix(0, nrow=6, ncol=280)
nextL
Anny
Here's one way:
plot(0:10, 0:10, pch=16)
lines(rep(0:10, each=3), t(matrix(c(0:10, rep(c(0,NA), each=11)),
ncol=3)))
HTH
Peter Alspach
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Anny Huang
> Sent: Monday, 8 September 2008 8:49 a
This should do it for you:
CODE NAME
13 aaa
23 aab
33 aac
44 bba
54 bbb
64 bbc
74 bbd
85 cca
95 ccb
> x.s <- split(x$NAME, x$CODE)
> maxLine <- max(table(x$CODE))
> # pad out the lines
> x.pad <- lapply(x.s, function(line){
+ # convert to characte
Dear R Gurus:
How would I create a vignette, please?
Why would a vignette be better than examples, please?
Thanks,
Edna Bell
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.
Hello,
I want to know how to draw a line connecting each point to the x-axis
perpendicularly (i.e. a vertical line).
abline(v=...) seems not to work for my purpose, because it runs over the
data point. Can anyone help? Thanks.
Anny
[[alternative HTML version deleted]]
__
Gabor - thanks for your suggestion... I had checked the previous post, but I
found (as a new user of R) this approach to be too complicated and I had
problems gaining the correct output values. If there is a simpler way of doing
this, then please feel free to let me know.
Dylan - thanks, your
Gabor - thanks for your suggestion... I had checked the previous post, but I
found (as a new user of R) this approach to be too complicated and I had
problems gaining the correct output values. If there is a simpler way of doing
this, then please feel free to let me know.
Dylan - thanks, your
On Sun, Sep 7, 2008 at 12:32 PM, Steve Murray <[EMAIL PROTECTED]> wrote:
>
>
> Dear all,
>
> I have a large dataset which I hope to reduce in size, to make it more
> useable. I hope to do this by taking an average of each 60 x 60 blockof
> values and forming a new data frame out of the averaged v
This was answered last month:
http://tolstoy.newcastle.edu.au/R/e4/help/08/08/19091.html
On Sun, Sep 7, 2008 at 3:32 PM, Steve Murray <[EMAIL PROTECTED]> wrote:
>
>
> Dear all,
>
> I have a large dataset which I hope to reduce in size, to make it more
> useable. I hope to do this by taking an av
On Sun, Sep 7, 2008 at 2:56 PM, Antje <[EMAIL PROTECTED]> wrote:
> Thanks a lot to Gabor and Duncan!
>
> I didn't know that XPath is a standard. I'll give it a deeper look to better
> understand it.
>
> Oh, I guess I understand a bit more
>
> xpathApply(doc, "//val", function(n) xmlValue(n))
or ju
Dear all,
I have a large dataset which I hope to reduce in size, to make it more useable.
I hope to do this by taking an average of each 60 x 60 blockof values and
forming a new data frame out of the averaged values.
How would I go about taking averages of 60 x 60 'blocks' in R, and cycling
Thanks a lot to Gabor and Duncan!
I didn't know that XPath is a standard. I'll give it a deeper look to better
understand it.
Oh, I guess I understand a bit more
xpathApply(doc, "//val", function(n) xmlValue(n))
would search globally for all nodes named "val" and return its values :-)
So tha
On Sun, Sep 7, 2008 at 12:10 PM, Gabor Grothendieck
<[EMAIL PROTECTED]> wrote:
> In particular try this:
>
>> Lines <- '
> +
> +
> + 22
> + 45
> +
> +
> + 44
> + 11
> +
> +
> + '
>>
>> library(XML)
>> doc <- xmlTreeParse(Lines, asText = TRUE, trim = TRUE, useInternalNo
check:
help("multinom", package = "nnet")
I hope it helps.
Best,
Dimitris
[EMAIL PROTECTED] wrote:
Hi,
y is nominal (3 categories), x1 to 3 is scale. What I want is a
regression, showing the probability to fall in one of the three
categories of y according to the x. How can I perform suc
Hi,
I've got a question regarding the restructering of a data set. What I have are
municipality zip-codes and the names of 5'000 built-up areas within
municipalities. The following example shows, what I would like to do:
Input (Zip-Codes and Names):
# CODE NAME
#1 3 aaa
#2
Hi,
y is nominal (3 categories), x1 to 3 is scale. What I want is a
regression, showing the probability to fall in one of the three
categories of y according to the x. How can I perform such a
regression in R?
Thanks for your help
Sören
__
R-h
Thanks very much. This is what I implemented. I found a similar example
elsewhere too.
It works fine now.
jholtman wrote:
>
> I would suggest that you use a list to store the values since it is
> easier to create and reference:
>
>> output <- list()
>> for (i in 1:10) output[[i]] <- seq(i)
>
Dear List:
I found an error when I called the 'gee' function. I cannot solve and explain
it. There are no errors when I used the 'geeglm' function. Both functions fit
the gee model. The project supervisor recommends me to use the 'gee' function.
But I cannot explain to him why this error h
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi Antje
Well, the XML package gives you a variety of ways to parse
an XML document and manipulate it in R.
Perhaps the approach that best matches the Java-style you
outline is to use XPath to access nodes.
To do this, you use
doc = xmlTreeParse("fi
Thanks Ben!
Switching over to the gamma pdf and using the algorithm="plinear" did the
trick.
jpl
--
View this message in context:
http://www.nabble.com/using-nls-to-fit-a-curve-to-data-tp19332210p19360761.html
Sent from the R help mailing list archive at Nabble.com.
_
Hi Kurt,
> Please tell me how to format data in a data frame so when currency amount is
> displayed in a chart the axis tick labels contain leading $ signs.
The easiest way is add a custom scale:
vals <- seq(0, 100, by = 10)
qplot(...) + scale_x_continuous(breaks = vals, labels = paste("$",
vals
I just CMD-C'd it and pasted it into OpenOffice with CMD-V.
el
On 07 Sep 2008, at 16:57 , John Kane wrote:
I think you need to save the plot and import it into Word. AFAIK
you can only copy and paste a plot in Windows.
Have a look at ?png (There are other formats available)
In particular try this:
> Lines <- '
+
+
+ 22
+ 45
+
+
+ 44
+ 11
+
+
+ '
>
> library(XML)
> doc <- xmlTreeParse(Lines, asText = TRUE, trim = TRUE, useInternalNodes =
> TRUE)
> root <- xmlRoot(doc)
>
> data1 <- getNodeSet(root, "//data")[[1]]
> xmlValue(getNodeSet(dat
On 7 Sep 2008, at 16:57, John Kane wrote:
I think you need to save the plot and import it into Word. AFAIK
you can only copy and paste a plot in Windows.
In the R.app GUI, you can click the plot window and then select "Copy"
from the "Edit" menu (or press Command-C). You can now past the
-- Forwarded message --
From: jim holtman <[EMAIL PROTECTED]>
Date: Sun, Sep 7, 2008 at 11:42 AM
Subject: Re: [R] request: most repeated sequnce
To: Muhammad Azam <[EMAIL PROTECTED]>
This should do it for you:
> x=c(1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,2,2,2,3,3,0,0,0,0,0,0,
On 7 September 2008 at 10:22, Antje wrote:
| I try to rewrite some Java-code with R. It deals with reading XML files. I
[...]
| Now, I'd like to do something like this in R. Most important would be to
| retrieve a node just by its name, not by the whole path. How is it possible?
|
| Can anybody
well not sure how its done in R , but heres a way to do it in simple Excel.
http://decisionstats.com/2008/parsing-xml-files-easily/
Parsing XML files easily
To parse a XML (or KML or PMML) file easily without using any
complicated softwares, here is a piece of code that fits right in your
excel s
I think you need to save the plot and import it into Word. AFAIK you can only
copy and paste a plot in Windows.
Have a look at ?png (There are other formats available)
--- On Sun, 9/7/08, asdfjkl; <[EMAIL PROTECTED]> wrote:
> From: asdfjkl; <[EMAIL PROTECTED]>
> Subject: [R] ON MAC, how to
Dear all,
I have a question on Cohen's kappa:
Assume I have two datasets, one has 500 objects, 10 methods and the other,
1000 different objects, 20 different methods. Could I compare between the
two datasets to conclude the 10 methods are more "concordant" than the 20
ones by looking at some outp
here is a simple approach to, for instance, plot scores for PC1 and
PC2 using diff colors:
scores <- prcomp(yourdata)$x
plot(scores[1:100,1], scores[1:100,2], pch = 20, col = "blue")
points(scores[101:200,1], scores[101:200,2], pch = 20, col = "red")
PM
On Sat, Sep 6, 2008 at 11:44 PM, pgseye <[
Hello
I am a newbie. I had my R upgraded from 2.7.1 to 2.7.2 and in doing so I
decided to install all 2.7 versions under c:\program files\R\2.7 from now on
(2.7.1 is located under .\2.7.1)
Although I don't like the idea (I am running Vista), I have edited
etc\Renviron.site to contain:
R_USER=
Carlos Morales wrote:
Hello everyone,
I would like to know if there is any function to calculate the mode value, or I
have to build one to do it.
Hi Carlos,
If you mean the mode of a sample from a discrete distribution, try Mode
in the prettyR package.
Jim
Dear all,
I encountered a problem on starting and using the R v 2.7.2 installation on
my PC running Windows Vista and would appreciate your help.
When R was first started, the Rgui returned several error messages:
Error in structure(.Internal(Sys.getenv(as.character(x),
as.character(unset)$ u
It's exactely what I was looking for.
Thanks a lot
--
View this message in context:
http://www.nabble.com/loop-tp19346683p19356409.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
https://stat.ethz.ch/
Thank you very much, Adam.
I have to get a bit more familiar with the model you propose in order to
understand if it applies to my problem as well.
My question is not really "does time show a different effect" but "which one
of two measures is more reliable": My respondents have completed exac
Hi there,
I try to rewrite some Java-code with R. It deals with reading XML files. I
started with the XML package. In Java, I had a very useful method which gave me
a node by using:
name of the node
index of appearance
start point: global (false) / local (true)
So, I could do something like
How are you executing the script? Quite possibly FAQ Q7.22 applies (it
will it you use source(), for example).
On Sat, 6 Sep 2008, Nathan Teuscher wrote:
I have the following code that when executed from the command line
works properly and produces a proper PDF. When the script is executed,
t
2008/9/7 asdfjkl; <[EMAIL PROTECTED]>:
>
> Yes, I don't know how to copy the plot on Mac and paste on to Word because
> you can't right click on the graph and say "copy as metafile."
> I'm so surprised I can't find any information about this anywhere on the
> Internet...
The obvious way would be t
Yes, I don't know how to copy the plot on Mac and paste on to Word because
you can't right click on the graph and say "copy as metafile."
I'm so surprised I can't find any information about this anywhere on the
Internet...
--
View this message in context:
http://www.nabble.com/ON-MAC%2C-how-to
56 matches
Mail list logo