This is a general question about Design of experiments. If i am not allowed
to post general questions like this here please accept my apologies and
ignore the question.
I did a DOE with six factors in eight runs. I know i cannot check for
interactions using this design, but i tried the interaction plot and it
showed me many interactions. After this I foldover the design and ran the 8
runs to learn about the interactions but i could not find any. Now my
question does the interaction plot of a resolution three design gives any
information about the possible interactions? why did the interaction plot
showed many interactions? I used Minitab for analysis, new to R so still
trying to figure out how to use R.
Thanks
Statistics novice
On 8/11/07, r-help-request@stat.math.ethz.ch <
r-help-request@stat.math.ethz.ch> wrote:>
> Send R-help mailing list submissions to
> r-help@stat.math.ethz.ch
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://stat.ethz.ch/mailman/listinfo/r-help
> or, via email, send a message with subject or body 'help' to
> r-help-request@stat.math.ethz.ch
>
> You can reach the person managing the list at
> r-help-owner@stat.math.ethz.ch
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of R-help digest..."
>
>
> Today's Topics:
>
> 1. Re: Combining two ANOVA outputs of different lengths
> (Peter Dalgaard)
> 2. Plot legend in margin (Daniel Brewer)
> 3. Re : compute ROC curve? (justin bem)
> 4. Re: reading xcms files (Prof Brian Ripley)
> 5. Re: GLMM: MEEM error due to dichotomous variables
> (lorenz.gygax@art.admin.ch)
> 6. Re: Plot legend in margin (Daniel Brewer)
> 7. Re: Plot legend in margin (Uwe Ligges)
> 8. Re: Positioning text in top left corner of plot (Daniel Brewer)
> 9. Re: Positioning text in top left corner of plot (Daniel Brewer)
> 10. Re: ordering a data.frame by average rank of multiple columns
> (Gabor Grothendieck)
> 11. having problems with factor() (Jabez Wilson)
> 12. Re: need help with pdf-plot (Ivar Herfindal)
> 13. Re: having problems with factor() (Henrique Dallazuanna)
> 14. help with counting how many times each value occur in each
> column (Tom Cohen)
> 15. Odp: having problems with factor() (Petr PIKAL)
> 16. Remove redundant observations for cross-validation
> (Eleni Rapsomaniki)
> 17. Re: Positioning text in top left corner of plot (Daniel Brewer)
> 18. Re: having problems with factor() (Rainer Hurling)
> 19. Re: [Fwd: Re: How to apply functions over rows of multiple
> matrices] (Gabor Grothendieck)
> 20. Odp: help with counting how many times each value occur in
> each column (Petr PIKAL)
> 21. Re: help with counting how many times each value occur in
> each column (Gabor Grothendieck)
> 22. Re: [Fwd: Re: How to apply functions over rows of multiple
> matrices] (Johannes H?sing)
> 23. Re: Odp: having problems with factor() (Jabez Wilson)
> 24. Re: Plot legend in margin (Greg Snow)
> 25. Re: Seasonality (Roland Rau)
> 26. Re: help with counting how many times each value occur in
> each column (Fran?ois Pinard)
> 27. Re: help with counting how many times each value occur in
> eachcolumn (Gasper Cankar)
> 28. Re: help with counting how many times each value occur in
> each column (Fran?ois Pinard)
> 29. rfImpute (Eric Turkheimer)
> 30. smoothing function for proportions (Rose Hoberman)
> 31. Re: smoothing function for proportions (Rose Hoberman)
> 32. Re: how to include bar values in a barplot? (Greg Snow)
> 33. Re: a question on lda{MASS} (Weiwei Shi)
> 34. Re: Subject: Re: how to include bar values in a barplot?
> (Greg Snow)
> 35. Re: smoothing function for proportions (roger koenker)
> 36. GLM with tweedie: NA for AIC (laran gines)
> 37. Test (ignore) (Nordlund, Dan (DSHS/RDA))
> 38. Re: Help using gPath (Emilio Gagliardi)
> 39. write.table (Weiwei Shi)
> 40. Re: small sample techniques (Nordlund, Dan (DSHS/RDA))
> 41. Re: small sample techniques (Nordlund, Dan (DSHS/RDA))
> 42. Cleaning up the memory (Monica Pisica)
> 43. need help to manipulate function and time interval
> (KOITA Lassana - STAC/ACE)
> 44. Re: need help to manipulate function and time interval
> (Henrique Dallazuanna)
> 45. Re: Cleaning up the memory (Prof Brian Ripley)
> 46. Re: write.table (Yinghai Deng)
> 47. Help wit matrices (Lanre Okusanya)
> 48. Re: Cleaning up the memory (Monica Pisica)
> 49. Re: Help wit matrices (jim holtman)
> 50. Row name of empty string issue (adiamond)
> 51. Re: Help wit matrices (Lanre Okusanya)
> 52. Re: Help wit matrices (Henrique Dallazuanna)
> 53. kde2d error message (Jennifer Dillon)
> 54. Re: Help wit matrices (Ravi Varadhan)
> 55. Re: Help wit matrices (John Kane)
> 56. half-logit and glm (again) (Richard D. Morey)
> 57. Re: write.table (Weiwei Shi)
> 58. Re: Cleaning up the memory (Prof Brian Ripley)
> 59. Re: Help wit matrices ( (Ted Harding))
> 60. Re: Help wit matrices (Roland Rau)
> 61. Re: kde2d error message (Prof Brian Ripley)
> 62. Re: need help to manipulate function and time interval
> (Uwe Ligges)
> 63. Re: need help to manipulate function and time interval
> (Uwe Ligges)
> 64. QUESTION ON R!!!!!!!!!!!1 (lecastil)
> 65. Re: R-excel (Peter Wickham)
> 66. Re: R-excel (Prof Brian Ripley)
> 67. Request (zahid khan)
> 68. Re: Help using gPath (Paul Murrell)
> 69. shell and shell.exec on Windows (Erich Neuwirth)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 10 Aug 2007 12:01:25 +0200
> From: Peter Dalgaard <p.dalgaard@biostat.ku.dk>
> Subject: Re: [R] Combining two ANOVA outputs of different lengths
> To: Christoph.Scherber@agr.uni-goettingen.de
> Cc: r-help@stat.math.ethz.ch
> Message-ID: <46BC3775.5080301@biostat.ku.dk>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Christoph Scherber wrote:
> > Dear R users,
> >
> > I have been trying to combine two anova outputs into one single table
> > (for later publication). The outputs are of different length, and
share
> > only some common explanatory variables.
> >
> > Using merge() or melt() (from the reshape package) did not work out.
> >
> > Here are the model outputs and what I would like to have:
> >
> > anova(model1)
> > numDF denDF F-value p-value
> > (Intercept) 1 74 0.063446 0.8018
> > days 1 74 6.613997 0.0121
> > logdiv 1 74 1.587983 0.2116
> > leg 1 74 4.425843 0.0388
> >
> > anova(model2)
> > numDF denDF F-value p-value
> > (Intercept) 1 73 165.94569 <.0001
> > funcgr 1 73 7.91999 0.0063
> > grass 1 73 42.16909 <.0001
> > leg 1 73 4.72108 0.0330
> > funcgr:grass 1 73 8.49068 0.0047
> >
> > #"merge(anova(model1),anova(model2),...)"
> >
> > F-value 1 p-val1 F-value 2 p-value 2
> > (Intercept) 0.063446 0.8018 165.94569 <.0001
> > days 6.613997 0.0121 NA NA
> > logdiv 1.587983 0.2116 NA NA
> > leg 4.425843 0.0388 4.72108 0.033
> > funcgr NA NA 7.91999 0.0063
> > grass NA NA 42.16909 <.0001
> > funcgr:grass NA NA 8.49068 0.0047
> >
> >
> > I would be glad if someone would have an idea of how to do this in
> > principle.
> >
> The main problems are that the merge key is the rownames and that you
> want to keep entries that are missing in one of the analysis. There are
> ways to deal with that:
>
> > example(anova.lm)
> .....
> > merge(anova(fit2), anova(fit4), by=0, all=T)
> Row.names Df.x Sum Sq.x Mean Sq.x F value.x Pr(>F).x Df.y Sum
Sq.y
> 1 ddpi NA NA NA NA NA 1 63.05403
> 2 dpi NA NA NA NA NA 1 12.40095
> 3 pop15 1 204.11757 204.11757 13.211166 0.000687868 1 204.11757
> 4 pop75 1 53.34271 53.34271 3.452517 0.069425385 1 53.34271
> 5 Residuals 47 726.16797 15.45038 NA NA 45 650.71300
> Mean Sq.y F value.y Pr(>F).y
> 1 63.05403 4.3604959 0.0424711387
> 2 12.40095 0.8575863 0.3593550848
> 3 204.11757 14.1157322 0.0004921955
> 4 53.34271 3.6889104 0.0611254598
> 5 14.46029 NA NA
>
>
>
> Presumably, you can take it from here.
>
>
>
> ------------------------------
>
> Message: 2
> Date: Fri, 10 Aug 2007 11:09:32 +0100
> From: Daniel Brewer <daniel.brewer@icr.ac.uk>
> Subject: [R] Plot legend in margin
> To: r-help@stat.math.ethz.ch
> Message-ID: <46BC395C.3080109@icr.ac.uk>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hi all,
> Another plotting question I am afraid. Is there anyway of putting a
> legend for a plot in a margin rather than within the figure. I am
> trying to plot a 3x2 plot and I want to have:
> 1) One key along the bottom for all the plots
> 2) A label (a,b,c) for each plot (see previous emails)
>
> Is there any websites etc. that explain this sort of thing?
>
> Dan
>
> --
> **************************************************************
> Daniel Brewer, Ph.D.
>
> Institute of Cancer Research
> Email: daniel.brewer@icr.ac.uk
> **************************************************************
>
> The Institute of Cancer Research: Royal Cancer Hospital, a charitable
> Company Limited by Guarantee, Registered in England under Company No.
534147
> with its Registered Office at 123 Old Brompton Road, London SW7 3RP.
>
> This e-mail message is confidential and for use by the addre...{{dropped}}
>
>
>
> ------------------------------
>
> Message: 3
> Date: Fri, 10 Aug 2007 10:28:49 +0000 (GMT)
> From: justin bem <justin_bem@yahoo.fr>
> Subject: [R] Re : compute ROC curve?
> To: gallon li <gallon.li@gmail.com>
> Cc: R Maillist <r-help@stat.math.ethz.ch>
> Message-ID: <156417.27358.qm@web23006.mail.ird.yahoo.com>
> Content-Type: text/plain
>
> see ROCR or accuracy package.
>
> Justin BEM
> BP 1917 Yaoundé
> Tél (237) 99597295
> (237) 22040246
>
> ----- Message d'origine ----
> De : gallon li <gallon.li@gmail.com>
> À : r-help <r-help@stat.math.ethz.ch>
> Envoyé le : Vendredi, 10 Août 2007, 4h15mn 36s
> Objet : [R] compute ROC curve?
>
> Hello,
>
> i have continuous test results for dieased and nondiseased subjects, say X
> and Y. Both are vectors of numbers.
>
> is there any R function which can generate the step function of ROC curve
> automatically?
>
> Thanks!
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>
>
>
>
>
>
>
>
______________________________________________________________________________
>
> ail !
> [[alternative HTML version deleted]]
>
>
>
> ------------------------------
>
> Message: 4
> Date: Fri, 10 Aug 2007 11:47:21 +0100 (BST)
> From: Prof Brian Ripley <ripley@stats.ox.ac.uk>
> Subject: Re: [R] reading xcms files
> To: Roberto Olivares Hernandez <roh@biocentrum.dtu.dk>
> Cc: "'r-help@stat.math.ethz.ch'"
<r-help@stat.math.ethz.ch>
> Message-ID: <Pine.LNX.4.64.0708101142260.20343@gannet.stats.ox.ac.uk>
> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
>
> On Fri, 10 Aug 2007, Roberto Olivares Hernandez wrote:
>
> > Hi,
> >
> > I am using xcms library to read mass spectrum data. I generate objects
> > from CDF files using the command line
> >
> >> SME10 <- xcmsRaw("SME_10.CDF")
> >
> > I have 50 CDF files with different name and I don't want to repeat
the
> > command for each one. Is there any option to read all the files and
> > generate a corresponding object name?
>
> Something like
>
> for(f in Sys.glob("*.CDF")) assign(sub("\\.CDF$",
"", f), xcmsRaw(f))
>
> (untested, of course).
>
> --
> Brian D. Ripley, ripley@stats.ox.ac.uk
> Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
> University of Oxford, Tel: +44 1865 272861 (self)
> 1 South Parks Road, +44 1865 272866 (PA)
> Oxford OX1 3TG, UK Fax: +44 1865 272595
>
>
>
> ------------------------------
>
> Message: 5
> Date: Fri, 10 Aug 2007 12:55:46 +0200
> From: <lorenz.gygax@art.admin.ch>
> Subject: Re: [R] GLMM: MEEM error due to dichotomous variables
> To: <r-help@stat.math.ethz.ch>
> Cc: elva_robinson@hotmail.com
> Message-ID:
> <
> 145C63777EF3ED41A5A99035845F7DD9D313AE@EVD-C8002.bk.evdad.admin.ch>
> Content-Type: text/plain; charset="iso-8859-1"
>
> > I am trying to run a GLMM on some binomial data. My fixed
> > factors include 2
> > dichotomous variables, day, and distance. When I run the model:
> >
> > modelA<-glmmPQL(Leaving~Trial*Day*Dist,random=~1|Indiv,family>
>"binomial")
> >
> > I get the error:
> >
> > iteration 1
> > Error in MEEM(object, conLin, control$niterEM) :
> > Singularity in backsolve at level 0, block 1
> >
> > >From looking at previous help topics,(
> > http://tolstoy.newcastle.edu.au/R/help/02a/4473.html)
> > I gather this is because of the dichotomous predictor
> > variables - what approach should I take to avoid this problem?
>
> Are you sure? I have never had problems including factors in a glmmPQL so
> far. More likely, the combination of your explanatory variables leads to a
> fragmentation in your response such that each combination of your factor
> levels only contain 0s or 1s. Thus, your model is 'too good' (it
has too
> many predictors given the amount of data). Try e.g. to fit a model without
> the interactions.
>
> Cheers, Lorenz
> -
> Lorenz Gygax
> Centre for proper housing of ruminants and pigs
> Agroscope Reckenholz-T?nikon Research Station ART
> T?nikon, CH-8356 Ettenhausen / Switzerland
>
>
>
> ------------------------------
>
> Message: 6
> Date: Fri, 10 Aug 2007 11:55:29 +0100
> From: Daniel Brewer <daniel.brewer@icr.ac.uk>
> Subject: Re: [R] Plot legend in margin
> To: Lauri Nikkinen <lauri.nikkinen@iki.fi>, r-help@stat.math.ethz.ch
> Message-ID: <46BC4421.2060100@icr.ac.uk>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Thanks. That got me onto the right track. Because it is a multiplot
> and I wanted it along the bottom, I found that I had to use par(xpd=NA)
> and then position it relative to the last of the multiplots. After a
> bit of trial and error I got there.
>
> Thanks
>
> Lauri Nikkinen wrote:
> > Very simple example:
> >
> > opar <- par(mar = c(10, 4, 4, 4))
> > plot(1:10)
> > lines(1:10)
> > par(xpd=TRUE)
> > legend(4,-1.5,lty=1, col="black", legend="straigh
line")
> > par(opar)
> >
> > -Lauri
>
> --
> **************************************************************
> Daniel Brewer, Ph.D.
> Institute of Cancer Research
> Email: daniel.brewer@icr.ac.uk
> **************************************************************
>
> The Institute of Cancer Research: Royal Cancer Hospital, a charitable
> Company Limited by Guarantee, Registered in England under Company No.
534147
> with its Registered Office at 123 Old Brompton Road, London SW7 3RP.
>
> This e-mail message is confidential and for use by the addre...{{dropped}}
>
>
>
> ------------------------------
>
> Message: 7
> Date: Fri, 10 Aug 2007 13:00:23 +0200
> From: Uwe Ligges <ligges@statistik.uni-dortmund.de>
> Subject: Re: [R] Plot legend in margin
> To: Daniel Brewer <daniel.brewer@icr.ac.uk>
> Cc: r-help@stat.math.ethz.ch
> Message-ID: <46BC4547.6020801@statistik.uni-dortmund.de>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
>
>
> Daniel Brewer wrote:
> > Hi all,
> > Another plotting question I am afraid. Is there anyway of putting a
> > legend for a plot in a margin rather than within the figure. I am
> > trying to plot a 3x2 plot and I want to have:
> > 1) One key along the bottom for all the plots
> > 2) A label (a,b,c) for each plot (see previous emails)
> >
> > Is there any websites etc. that explain this sort of thing?
>
> Please read the posting guide.
>
> After that, type:
> RSiteSearch("legend margin")
>
> Currently, the fourth entry shows a solution:
> http://finzi.psych.upenn.edu/R/Rhelp02a/archive/67979.html
>
> Uwe Ligges
>
>
> > Dan
> >
>
>
>
> ------------------------------
>
> Message: 8
> Date: Fri, 10 Aug 2007 12:03:56 +0100
> From: Daniel Brewer <daniel.brewer@icr.ac.uk>
> Subject: Re: [R] Positioning text in top left corner of plot
> To: S Ellison <S.Ellison@lgc.co.uk>, r-help@stat.math.ethz.ch
> Message-ID: <46BC461C.1010308@icr.ac.uk>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Thanks. That works if it is only a single plot, but if there are
> multiple plots (e.g. par(mfrow=c(2,2))) it confusingly puts the label in
> the absolute top left always i.e. the top left of plot one.
>
> Dan
>
> S Ellison wrote:
> > Try something like
> > mtext(side=3, line=-1, text="Here again?", adj=0, outer=T)
> >
> > This puts text just inside the top left corner.
> >
> >
> >>>> Jim Lemon <jim@bitwrit.com.au> 10/08/2007 10:37:30
>>>
> > Daniel Brewer wrote:
> >> Thanks for the replies, but I still cannot get what I want. I do
not
> >> want the label inside the plot area, but in the top left of the
paper,
> I
> >> suppose in the margins. When I try to use text to do this, it
does not
> >> seem to plot it outside the plot area. I have also tried to use
mtext,
> >> but that does not really cut it, as I cannot get the label in the
> >> correct position. Ideally, it would be best if I could use legend
but
> >> have it outside the plot area.
> >>
> >> Any ideas?
> >>
> > Hi Dan,
> >
> > Try this:
> >
> > plot(1:5)
> > par(xpd=TRUE)
> > text(0.5,5.5,"Outside")
> > par(xpd=FALSE)
> >
> > Jim
>
>
> The Institute of Cancer Research: Royal Cancer Hospital, a charitable
> Company Limited by Guarantee, Registered in England under Company No.
534147
> with its Registered Office at 123 Old Brompton Road, London SW7 3RP.
>
> This e-mail message is confidential and for use by the addre...{{dropped}}
>
>
>
> ------------------------------
>
> Message: 9
> Date: Fri, 10 Aug 2007 12:05:31 +0100
> From: Daniel Brewer <daniel.brewer@icr.ac.uk>
> Subject: Re: [R] Positioning text in top left corner of plot
> To: Paul Murrell <paul@stat.auckland.ac.nz>
> Cc: r-help@stat.math.ethz.ch
> Message-ID: <46BC467B.2070309@icr.ac.uk>
> Content-Type: text/plain; charset=ISO-8859-1
>
> This works fine for one plot, but if it is a multiple plot (mfrow=c(2,2)
> say) then each individual label is placed in the same position i.e.
> absolute top left on the canvas. I would like it top left of each
> individual plot.
>
> Thanks anyway. Got any idea how to fix this?
>
> Dan
>
> Paul Murrell wrote:
> > Hi
> >
> >
> > Daniel Brewer wrote:
> >> Thanks for the replies, but I still cannot get what I want. I do
not
> >> want the label inside the plot area, but in the top left of the
paper,
> I
> >> suppose in the margins. When I try to use text to do this, it
does not
> >> seem to plot it outside the plot area. I have also tried to use
mtext,
> >> but that does not really cut it, as I cannot get the label in the
> >> correct position. Ideally, it would be best if I could use legend
but
> >> have it outside the plot area.
> >>
> >> Any ideas?
> >
> >
> > plot(1:10)
> > library(grid)
> > grid.text("What do we want? Text in the corner!\nWhere do we
want it?
> > Here!",
> > x=unit(2, "mm"), y=unit(1, "npc") -
unit(2, "mm"),
> > just=c("left", "top"))
> >
> > Paul
> >
> >
> >> Thanks
> >>
> >> Benilton Carvalho wrote:
> >>> maybe this is what you want?
> >>>
> >>> plot(rnorm(10))
> >>> legend("topleft", "A)", bty="n")
> >>>
> >>> ?
> >>>
> >>> b
> >>>
> >>> On Aug 7, 2007, at 11:08 AM, Daniel Brewer wrote:
> >>>
> >>>> Simple question how can you position text in the top left
hand
> >>>> corner of
> >>>> a plot? I am plotting multiple plots using
par(mfrow=c(2,3)) and all
> I
> >>>> want to do is label these plots a), b), c) etc. I have
been fiddling
> >>>> around with both text and mtext but without much luck.
text is fine
> >>>> but
> >>>> each plot has a different scale on the axis and so this
makes it
> >>>> problematic. What is the best way to do this?
> >>>>
> >>>> Many thanks
> >>>>
> >>>> Dan
> >
> >
>
>
> The Institute of Cancer Research: Royal Cancer Hospital, a charitable
> Company Limited by Guarantee, Registered in England under Company No.
534147
> with its Registered Office at 123 Old Brompton Road, London SW7 3RP.
>
> This e-mail message is confidential and for use by the addre...{{dropped}}
>
>
>
> ------------------------------
>
> Message: 10
> Date: Fri, 10 Aug 2007 07:36:11 -0400
> From: "Gabor Grothendieck" <ggrothendieck@gmail.com>
> Subject: Re: [R] ordering a data.frame by average rank of multiple
> columns
> To: "Tom.O" <tom.olsson@dnbnor.com>
> Cc: r-help@stat.math.ethz.ch
> Message-ID:
> <971536df0708100436p3efc4d19me89f4a83ffd546d6@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Try this:
>
> positions <- order(ranks)
>
> On 8/10/07, Tom.O <tom.olsson@dnbnor.com> wrote:
> >
> > Hi
> >
> > I have run into a problem and i wonder if anyone has a smart way of
> doing
> > this.
> >
> > For example i have this data frame for 5 different test groups:
> >
> > Res1 <- c(1,5,4,-0.5,3)
> > Res2 <- c(-1,8,2,0,3)
> > Mean <- c(0.5,1,1.5,-.5,2)
> > MyFrame <- data.frame(Res1,Res2,Mean,row.names=c
>
("G1","G2","G3","G4","G5"))
> >
> > where the first two columns are the results of two different tests,
the
> > third column is the mean of the group.
> >
> > I want to order this data.frame by the combined rank of Res1 &
Res2, but
> > where weigths are assigned to the importeance av each column. Lets
> assume
> > that Res1 is twice as important and lower values rank better.
> >
> > MyRanks<-data.frame
>
(Rank1=rank(MyFrame[,"Res1"]),Rank2=rank(MyFrame[,"Res2"]),CombR=2*rank(MyFrame[,"Res1"])+rank(MyFrame[,"Res2"]),
>
row.names=c("G1","G2","G3","G4","G5"))
> >
> > Rank1 Rank2 CombR
> > G1 2 1 5
> > G2 5 5 15
> > G3 4 3 11
> > G4 1 2 4
> > G5 3 4 10
> >
> >
> > and the rank of the combined is 2,5,4,1,3 , but to be able to sort
> MyFrame
> > in that order I need to enter this vector of positions c(4,1,5,3,2)
but
> do
> > anyone have a smart way of converting ranks to positions?
> >
> > Tom
> >
> >
> > --
> > View this message in context:
>
http://www.nabble.com/ordering-a-data.frame-by-average-rank-of-multiple-columns-tf4247393.html#a12087498
> > Sent from the R help mailing list archive at Nabble.com.
> >
> > ______________________________________________
> > R-help@stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >
>
>
>
> ------------------------------
>
> Message: 11
> Date: Fri, 10 Aug 2007 11:41:53 +0000 (GMT)
> From: Jabez Wilson <jabezwuk@yahoo.co.uk>
> Subject: [R] having problems with factor()
> To: R-Help <r-help@stat.math.ethz.ch>
> Message-ID: <266689.93457.qm@web27410.mail.ukl.yahoo.com>
> Content-Type: text/plain
>
> Dear R Help,
> I have a set of data of heights of trees described by area that they are
> in. The areas are numerical (0 to 7).
>
> ht area
> 1 320 3
> 2 410 4
> 3 230 2
> 4 360 3
> 5 126 1
> 6 280 2
> 7 260 2
> 8 280 2
> 9 280 2
> 10 260 2
> .......
> 180 450 4
> 181 90 1
> 182 120 1
> 183 440 4
> 184 210 2
> 185 330 3
> 186 210 2
> 187 100 1
> 188 0 0
>
> I want to convert the area column values to factors, to do an anova.
> However, if I use:
>
> df$areaf <- factor(df$area,
>
labels=c("0","I","II","III","IV","V","VI","VII"))
>
> it gives the following message:
>
> Error in factor(df$area, labels = c("0", "I",
"II", "III", "IV", "V",
> "VI", :
> invalid labels; length 8 should be 1 or 7
>
> Can anyone help?
>
> Jabez
>
>
> ___________________________________________________________
>
> now.
>
> [[alternative HTML version deleted]]
>
>
>
> ------------------------------
>
> Message: 12
> Date: Fri, 10 Aug 2007 13:41:38 +0200
> From: Ivar Herfindal <ivar.herfindal@bio.ntnu.no>
> Subject: Re: [R] need help with pdf-plot
> To: Antje <antje.niederlein@yahoo.de>
> Cc: r-help@stat.math.ethz.ch
> Message-ID: <46BC4EF2.7060504@bio.ntnu.no>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Dear Antje
>
> I cannot see that you have got any replies yet, so I will make and
> attempt. However, I am sure other have more formally correct solutions.
>
> When you call the pdf(), you can set paper="a4" (or
"a4r" for
> landscape). However, the width and the height of your plot should then
> not exceed the size of the paper (which is approximately 8.27*11.69
> inches for "a4"). Try (I have only tested on windows XP, R
2.5.0):
>
> pdf("test1.pdf", width=10, heigh=5, paper="a4r")
> par(mfrow=c(1,3), pty="s") #pty="s" gives square
plotting regions
> plot(rnorm(100))
> plot(rnorm(100))
> plot(rnorm(100))
> dev.off()
>
> Hope this helps
>
> Ivar
>
>
> Antje skrev:
> > I still have this problem. Does anybody know any solution?
> >
> > Antje
> >
> > Antje schrieb:
> >
> >> Hello,
> >>
> >> I'm trying to plot a set of barplots like a matrix (2 rows, 10
columns
> >> from"reduced_mat") to a pdf. It works with the following
parameters:
> >>
> >> pdf("test.pdf",width=ncol(reduced_mat)*2,
height=nrow(reduced_mat)*2,
> pointsize
> >> = 12)
> >>
> >> par(mfcol = c(nrow(reduced_mat),ncol(reduced_mat)), oma =
c(0,0,0,0),
> >> lwd=48/96, cex.axis = 0.5, las = 2, cex.main = 1.0)
> >>
> >> The I get a long narrow page format with the quadratic barplots.
> >>
> >> But I would like to have a A4 format in the end and the plots not
> filling the
> >> whole page (they should stay somehow quadratic and not be
> stretched...).
> >>
> >> What shall I look for to achieve this?
> >>
> >> Antje
> >>
> >> ______________________________________________
> >> R-help@stat.math.ethz.ch mailing list
> >> https://stat.ethz.ch/mailman/listinfo/r-help
> >> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> >> and provide commented, minimal, self-contained, reproducible code.
> >>
> >>
> >
> > ______________________________________________
> > R-help@stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >
>
>
>
> ------------------------------
>
> Message: 13
> Date: Fri, 10 Aug 2007 08:50:44 -0300
> From: "Henrique Dallazuanna" <wwwhsd@gmail.com>
> Subject: Re: [R] having problems with factor()
> To: "Jabez Wilson" <jabezwuk@yahoo.co.uk>
> Cc: R-Help <r-help@stat.math.ethz.ch>
> Message-ID:
> <da79af330708100450h44bc9541mf584d4e0c56a9e26@mail.gmail.com>
> Content-Type: text/plain
>
> Hi,
>
> df
> ht area
> 1 320 3
> 2 410 4
> 3 230 2
> 4 360 3
> 5 126 1
> 6 280 2
> 7 260 2
> 8 280 2
> 9 280 2
> 10 260 2
>
> df$area <- as.factor(df$area)
> levels(df$area) <- c("I", "II", "III",
"IV")
>
>
>
> --
> Henrique Dallazuanna
> Curitiba-Paraná-Brasil
> 25° 25' 40" S 49° 16' 22" O
>
> On 10/08/07, Jabez Wilson <jabezwuk@yahoo.co.uk> wrote:
> >
> > Dear R Help,
> > I have a set of data of heights of trees described by area that they
are
> > in. The areas are numerical (0 to 7).
> >
> > ht area
> > 1 320 3
> > 2 410 4
> > 3 230 2
> > 4 360 3
> > 5 126 1
> > 6 280 2
> > 7 260 2
> > 8 280 2
> > 9 280 2
> > 10 260 2
> > .......
> > 180 450 4
> > 181 90 1
> > 182 120 1
> > 183 440 4
> > 184 210 2
> > 185 330 3
> > 186 210 2
> > 187 100 1
> > 188 0 0
> >
> > I want to convert the area column values to factors, to do an anova.
> > However, if I use:
> >
> > df$areaf <- factor(df$area,
> >
labels=c("0","I","II","III","IV","V","VI","VII"))
> >
> > it gives the following message:
> >
> > Error in factor(df$area, labels = c("0", "I",
"II", "III", "IV", "V",
> > "VI", :
> > invalid labels; length 8 should be 1 or 7
> >
> > Can anyone help?
> >
> > Jabez
> >
> >
> > ___________________________________________________________
> >
> > now.
> >
> > [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-help@stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> > http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >
>
> [[alternative HTML version deleted]]
>
>
>
> ------------------------------
>
> Message: 14
> Date: Fri, 10 Aug 2007 14:01:44 +0200 (CEST)
> From: Tom Cohen <tom.cohen78@yahoo.se>
> Subject: [R] help with counting how many times each value occur in
> each column
> To: r-help@stat.math.ethz.ch
> Message-ID: <570265.73780.qm@web23006.mail.ird.yahoo.com>
> Content-Type: text/plain
>
> Dear list,
> I have the following dataset and want to know how many times each value
> occur in each column.
> >data
> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
> [1,] -100 -100 -100 0 0 0 0 0 0 -100
> [2,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> [3,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> [4,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> [5,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -50
> [6,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> [7,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> [8,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> [9,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> [10,] -100 -100 -100 -50 -100 -100 -100 -100 -100 -100
> [11,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> [12,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> [13,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> [14,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> [15,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> [16,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> [17,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> [18,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> [19,] -100 -100 -100 0 0 0 0 0 0 -100
> [20,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> The result matrix should look like
> -100 0 -50
> [1] 20
> [2] 20
> [3] 20
> [4] 17
> [5] 18
> [6] 18
> [7] 18 and so on
> [8]
> [9]
> [10]
>
> How can I do this in R ?
> Thanks alot for your help,
> Tom
>
>
> ---------------------------------
>
> Jämför pris på flygbiljetter och hotellrum:
> http://shopping.yahoo.se/c-169901-resor-biljetter.html
> [[alternative HTML version deleted]]
>
>
>
> ------------------------------
>
> Message: 15
> Date: Fri, 10 Aug 2007 14:02:21 +0200
> From: Petr PIKAL <petr.pikal@precheza.cz>
> Subject: [R] Odp: having problems with factor()
> To: Jabez Wilson <jabezwuk@yahoo.co.uk>
> Cc: R-Help <r-help@stat.math.ethz.ch>
> Message-ID:
> <
> OF53CE58BC.6CC27AD5-ONC1257333.0041ED7A-C1257333.00421CE9@precheza.cz>
>
> Content-Type: text/plain; charset="US-ASCII"
>
> Hi
> r-help-bounces@stat.math.ethz.ch napsal dne 10.08.2007 13:41:53:
>
> > Dear R Help,
> > I have a set of data of heights of trees described by area that they
are
> in.
> > The areas are numerical (0 to 7).
> >
> > ht area
> > 1 320 3
> > 2 410 4
> > 3 230 2
> > 4 360 3
> > 5 126 1
> > 6 280 2
> > 7 260 2
> > 8 280 2
> > 9 280 2
> > 10 260 2
> > .......
> > 180 450 4
> > 181 90 1
> > 182 120 1
> > 183 440 4
> > 184 210 2
> > 185 330 3
> > 186 210 2
> > 187 100 1
> > 188 0 0
> >
> > I want to convert the area column values to factors, to do an anova.
> However, if I use:
> >
> > df$areaf <- factor(df$area,
>
labels=c("0","I","II","III","IV","V","VI","VII"))
> >
> > it gives the following message:
> >
>
> Hm, maybe some of the values are missing
>
> > num<-sample(1:3, 10, replace=T)
> > num
> [1] 1 3 1 2 3 3 1 3 3 3
> > factor(num, labels=c("O", "I", "II"))
> [1] O II O I II II O II II II
> Levels: O I II
>
> > factor(num, labels=c("O", "I", "II",
"III"))
> Error in factor(num, labels = c("O", "I",
"II", "III")) :
> invalid labels; length 4 should be 1 or 3
> >
>
> try
>
> table(df$area)
> to see what level you really have
>
> Regards
> Petr
>
>
> > Error in factor(df$area, labels = c("0", "I",
"II", "III", "IV", "V",
> "VI", :
> > invalid labels; length 8 should be 1 or 7
> >
> > Can anyone help?
> >
> > Jabez
> >
> >
> > ___________________________________________________________
> >
> > now.
> >
> > [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-help@stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
>
>
> ------------------------------
>
> Message: 16
> Date: Fri, 10 Aug 2007 13:03:49 +0100
> From: Eleni Rapsomaniki <e.rapsomaniki@mail.cryst.bbk.ac.uk>
> Subject: [R] Remove redundant observations for cross-validation
> To: r-help@stat.math.ethz.ch
> Message-ID: <1186747429.46bc54250e417@webmail.cryst.bbk.ac.uk>
> Content-Type: text/plain; charset=ISO-8859-1
>
>
>
> Hi,
>
> This is a general statistics question that I believe occurs often so may
> have
> some R functions/packages dedicated to it.
> Suppose you want to check the accuracy of a classifier using a large
> training
> data-set where each row represents an observation. Is there a simple
> approach
> for removing redundant rows (rows with very similar values for all
> columns)
> from the training data so as to obtain a realistic classification
> performance
> upon x-validation? The only one I can think of is clustering the data into
> an
> arbitary number of clusters and selecting one observation from each
> cluster.
>
> e.g
> library(cluster)
> x <- rbind(cbind(rnorm(10,0,0.5), rnorm(10,0,0.5)),
> cbind(rnorm(10,5,2.5), rnorm(15,5,2.5)),
> cbind(rnorm(10,15,0.5), rnorm(15,15,0.5)),
> cbind(rnorm(5,5,0.1), rnorm(5,5,0.1)))
>
> pamx <- pam(x, 15)
>
> y=array(NA, dim=c(15,ncol(x)))
> for(i in 1:15){
> y[i,]=x[sample(which(pamx$clustering==i), 1),]
> }
>
> This seems a bit subjective though... Any better ideas?
>
> Eleni Rapsomaniki
>
>
>
> ------------------------------
>
> Message: 17
> Date: Fri, 10 Aug 2007 13:06:11 +0100
> From: Daniel Brewer <daniel.brewer@icr.ac.uk>
> Subject: Re: [R] Positioning text in top left corner of plot
> To: Jim Lemon <jim@bitwrit.com.au>
> Cc: r-help@stat.math.ethz.ch
> Message-ID: <46BC54B3.3090506@icr.ac.uk>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Jim Lemon wrote:
> > Daniel Brewer wrote:
> >> Thanks for the replies, but I still cannot get what I want. I do
not
> >> want the label inside the plot area, but in the top left of the
paper,
> I
> >> suppose in the margins. When I try to use text to do this, it
does not
> >> seem to plot it outside the plot area. I have also tried to use
mtext,
> >> but that does not really cut it, as I cannot get the label in the
> >> correct position. Ideally, it would be best if I could use legend
but
> >> have it outside the plot area.
> >>
> >> Any ideas?
> >>
> > Hi Dan,
> >
> > Try this:
> >
> > plot(1:5)
> > par(xpd=TRUE)
> > text(0.5,5.5,"Outside")
> > par(xpd=FALSE)
> >
> > Jim
>
> Here is what I used in the end:
> par(xpd=T)
> text(-0.15*
>
(par("usr")[2]-par("usr")[1]),par("usr")[4]+0.14*(par("usr")[4]-par("usr")[3]),labels[i],cex>
1.5)
> par(xpd=F)
>
> Ans that worked a treat.
> Thanks
>
> Dan
>
> --
> **************************************************************
> Daniel Brewer, Ph.D.
> Institute of Cancer Research
> Email: daniel.brewer@icr.ac.uk
> **************************************************************
>
> The Institute of Cancer Research: Royal Cancer Hospital, a charitable
> Company Limited by Guarantee, Registered in England under Company No.
534147
> with its Registered Office at 123 Old Brompton Road, London SW7 3RP.
>
> This e-mail message is confidential and for use by the addre...{{dropped}}
>
>
>
> ------------------------------
>
> Message: 18
> Date: Fri, 10 Aug 2007 14:11:37 +0200
> From: Rainer Hurling <rhurlin@gwdg.de>
> Subject: Re: [R] having problems with factor()
> To: Jabez Wilson <jabezwuk@yahoo.co.uk>, Henrique Dallazuanna
> <wwwhsd@gmail.com>
> Cc: r-help@stat.math.ethz.ch
> Message-ID: <46BC55F9.1020601@gwdg.de>
> Content-Type: text/plain; charset=ISO-8859-15; format=flowed
>
> I am afraid the above example will not work. In original dataset of
> Jabez Wilson numerical range is from 0..7.
>
> So try this one:
>
>
df<-as.factor(c("0","I","II","III","IV","V","VI","VII")[df$area+1])
>
> Hope this is what you want,
> Rainer
>
>
> Henrique Dallazuanna schrieb:
> > Hi,
> >
> > df
> > ht area
> > 1 320 3
> > 2 410 4
> > 3 230 2
> > 4 360 3
> > 5 126 1
> > 6 280 2
> > 7 260 2
> > 8 280 2
> > 9 280 2
> > 10 260 2
> >
> > df$area <- as.factor(df$area)
> > levels(df$area) <- c("I", "II",
"III", "IV")
> >
> >
> > On 10/08/07, Jabez Wilson <jabezwuk@yahoo.co.uk> wrote:
> >> Dear R Help,
> >> I have a set of data of heights of trees described by area that
they
> >> are in. The areas are numerical (0 to 7).
> >>
> >> ht area
> >> 1 320 3
> >> 2 410 4
> >> 3 230 2
> >> 4 360 3
> >> 5 126 1
> >> 6 280 2
> >> 7 260 2
> >> 8 280 2
> >> 9 280 2
> >> 10 260 2
> >> .......
> >> 180 450 4
> >> 181 90 1
> >> 182 120 1
> >> 183 440 4
> >> 184 210 2
> >> 185 330 3
> >> 186 210 2
> >> 187 100 1
> >> 188 0 0
> >>
> >> I want to convert the area column values to factors, to do an
anova.
> >> However, if I use:
> >>
> >> df$areaf <- factor(df$area,
> >>
labels=c("0","I","II","III","IV","V","VI","VII"))
> >>
> >> it gives the following message:
> >>
> >> Error in factor(df$area, labels = c("0", "I",
"II", "III", "IV", "V",
> >> "VI", :
> >> invalid labels; length 8 should be 1 or 7
> >>
> >> Can anyone help?
> >>
> >> Jabez
>
>
>
> ------------------------------
>
> Message: 19
> Date: Fri, 10 Aug 2007 08:16:05 -0400
> From: "Gabor Grothendieck" <ggrothendieck@gmail.com>
> Subject: Re: [R] [Fwd: Re: How to apply functions over rows of
> multiple matrices]
> To: johannes@huesing.name
> Cc: r-help@stat.math.ethz.ch
> Message-ID:
> <971536df0708100516l2b6638b4rb9eb4d2682157074@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> 1. matrices are stored columnwise so R is better at column-wise operations
> than row-wise.
>
> 2. Here is one way to do it (although I am not sure its better than the
> index approach):
>
> row.apply <- function(f, a, b)
> t(mapply(f, as.data.frame(t(a)), as.data.frame(t(b))))
>
> 3. The code for the example in this post could be simplified to:
>
> first.1 <- apply(cbind(goldstandard, 1), 1, which.max)
> ifelse(col(newtest) > first.1, NA, newtest)
>
> 4. given that both examples did not inherently need row by row operations
> I wonder if that is the wrong generalization in the first place?
>
>
> On 8/10/07, Johannes H?sing <johannes@huesing.name> wrote:
> > [Apologies to Gabor, who I sent a personal copy of the reply
> > erroneously instead of posting to List directly]
> >
> > [...]
> > > Perhaps what you really intend is to
> > > take the average over those elements in each row of the first
matrix
> > which correspond to 1's in the second in the corresponding
> > > row of the second. In that case its just:
> > >
> > > rowSums(newtest * goldstandard) / rowSums(goldstandard)
> > >
> >
> > Thank you for clearing my thoughts about the particular example.
> > My question was a bit more general though, as I have different
> > functions which are applied row-wise to multiple matrices. An
> > example that sets all values of a row of matrix A to NA after the
> > first occurrence of TRUE in matrix B.
> >
> > fillfrom <- function(applvec, testvec=NULL) {
> > if (is.null(testvec)) testvec <- applvec
> > if (length(testvec) != length(applvec)) {
> > stop("applvec and testvec have to be of same length!")
> > } else if(any(testvec, na.rm=TRUE)) {
> > applvec[min(which(testvec)) : length(applvec)] <- NA
> > }
> > applvec
> > }
> >
> > fillafter <- function(applvec, testvec=NULL) {
> > if (is.null(testvec)) testvec <- applvec
> > fillfrom(applvec, c(FALSE, testvec[-length(testvec)]))
> > }
> >
> > numtest <- 6
> > numsubj <- 20
> >
> > newtest <- array(rbinom(numtest*numsubj, 1, .5),
> > dim=c(numsubj, numtest))
> > goldstandard <- array(rbinom(numtest*numsubj, 1, .5),
> > dim=c(numsubj, numtest))
> >
> > newtest.NA <- t(sapply(1:nrow(newtest), function(i) {
> > fillafter(newtest[i,], goldstandard[i,]==1)}))
> >
> > My general question is if R provides some syntactic sugar
> > for the awkward sapply(1:nrow(A)) expression. Maybe in this
> > case there is also a way to bypass the apply mechanism and
> > my way of thinking about the problem has to be adapted. But
> > as the *apply calls are galore in R, I feel this is a standard
> > way of dealing with vectors and matrices.
> >
> >
> >
> >
> >
> > --
> >
> > ______________________________________________
> > R-help@stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >
>
>
>
> ------------------------------
>
> Message: 20
> Date: Fri, 10 Aug 2007 14:42:16 +0200
> From: Petr PIKAL <petr.pikal@precheza.cz>
> Subject: [R] Odp: help with counting how many times each value occur
> in each column
> To: Tom Cohen <tom.cohen78@yahoo.se>
> Cc: r-help@stat.math.ethz.ch
> Message-ID:
> <
> OFB69CE2C1.78D8A4B4-ONC1257333.00459B57-C1257333.0045C459@precheza.cz>
>
> Content-Type: text/plain; charset="ISO-8859-2"
>
> Hi
>
> > mat<-sample(c(-50,0,-100), 100,replace=T)
> > dim(mat)<-c(10,10)
> > mat
> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
> [1,] 0 0 0 0 -50 0 0 0 0 0
> [2,] -100 -100 -50 -50 0 0 -100 -50 -100 -50
> [3,] 0 -50 -100 -100 0 -50 -100 0 0 -100
> [4,] 0 -100 0 -50 -100 -100 -50 -50 0 -100
> [5,] -50 -50 0 0 0 -100 -100 -100 0 -100
> [6,] 0 0 -50 -50 0 0 -100 -100 -50 -100
> [7,] -100 -100 -100 -50 -100 0 -100 -100 0 -100
> [8,] -100 0 0 0 0 -100 0 -100 0 -100
> [9,] -100 0 -50 -100 -50 0 0 -50 0 -100
> [10,] -50 -100 0 0 -50 -50 -50 -50 -100 -100
>
> > apply(mat, 2, table)
> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
> -100 4 4 2 2 2 3 5 4 2 8
> -50 2 2 3 4 3 2 2 4 1 1
> 0 4 4 5 4 5 5 3 2 7 1
>
> Transposing and ordering columns is up to you.
>
> Regards
> Petr
>
> r-help-bounces@stat.math.ethz.ch napsal dne 10.08.2007 14:01:44:
>
> > Dear list,
> > I have the following dataset and want to know how many times each
> value
> > occur in each column.
> > >data
> > [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
> > [1,] -100 -100 -100 0 0 0 0 0 0 -100
> > [2,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> > [3,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> > [4,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> > [5,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -50
> > [6,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> > [7,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> > [8,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> > [9,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> > [10,] -100 -100 -100 -50 -100 -100 -100 -100 -100 -100
> > [11,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> > [12,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> > [13,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> > [14,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> > [15,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> > [16,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> > [17,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> > [18,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> > [19,] -100 -100 -100 0 0 0 0 0 0 -100
> > [20,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> > The result matrix should look like
> > -100 0 -50
> > [1] 20
> > [2] 20
> > [3] 20
> > [4] 17
> > [5] 18
> > [6] 18
> > [7] 18 and so on
> > [8]
> > [9]
> > [10]
> >
> > How can I do this in R ?
> > Thanks alot for your help,
> > Tom
> >
> >
> > ---------------------------------
> >
> > J?mf?r pris p? flygbiljetter och hotellrum:
> http://shopping.yahoo.se/c-169901-
> > resor-biljetter.html
> > [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-help@stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
>
>
> ------------------------------
>
> Message: 21
> Date: Fri, 10 Aug 2007 09:23:38 -0400
> From: "Gabor Grothendieck" <ggrothendieck@gmail.com>
> Subject: Re: [R] help with counting how many times each value occur in
> each column
> To: "Tom Cohen" <tom.cohen78@yahoo.se>
> Cc: r-help@stat.math.ethz.ch
> Message-ID:
> <971536df0708100623o2ebd4845w7ae398fdca97c98e@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Try this where we have constructed the example to illustrate that
> it does handle the case where not all values are in each column:
>
> mat <- matrix(rep(1:6, each = 4), 6)
>
> table(col(mat), mat)
>
> On 8/10/07, Tom Cohen <tom.cohen78@yahoo.se> wrote:
> > Dear list,
> > I have the following dataset and want to know how many times each
value
> occur in each column.
> > >data
> > [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
> > [1,] -100 -100 -100 0 0 0 0 0 0 -100
> > [2,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> > [3,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> > [4,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> > [5,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -50
> > [6,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> > [7,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> > [8,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> > [9,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> > [10,] -100 -100 -100 -50 -100 -100 -100 -100 -100 -100
> > [11,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> > [12,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> > [13,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> > [14,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> > [15,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> > [16,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> > [17,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> > [18,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> > [19,] -100 -100 -100 0 0 0 0 0 0 -100
> > [20,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> > The result matrix should look like
> > -100 0 -50
> > [1] 20
> > [2] 20
> > [3] 20
> > [4] 17
> > [5] 18
> > [6] 18
> > [7] 18 and so on
> > [8]
> > [9]
> > [10]
> >
> > How can I do this in R ?
> > Thanks alot for your help,
> > Tom
> >
> >
> > ---------------------------------
> >
> > J?mf?r pris p? flygbiljetter och hotellrum:
> http://shopping.yahoo.se/c-169901-resor-biljetter.html
> > [[alternative HTML version deleted]]
> >
> >
> > ______________________________________________
> > R-help@stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >
> >
>
>
>
> ------------------------------
>
> Message: 22
> Date: Fri, 10 Aug 2007 15:24:34 +0200 (CEST)
> From: Johannes H?sing <johannes@huesing.name>
> Subject: Re: [R] [Fwd: Re: How to apply functions over rows of
> multiple matrices]
> To: r-help@stat.math.ethz.ch
> Message-ID: <20473.129.206.90.2.1186752274.squirrel@mail.panix.com>
> Content-Type: text/plain;charset=iso-8859-1
>
> > 1. matrices are stored columnwise so R is better at column-wise
> operations
> > than row-wise.
>
> I am seeing this by my code which contains more t() than
> what seems healthy. However, the summaries are patient-wise
> over repeated measurements. Out of convention, I am storing
> patients in rows and measurements in columns.
>
> >
> > 2. Here is one way to do it (although I am not sure its better than
the
> > index approach):
> >
> > row.apply <- function(f, a, b)
> > t(mapply(f, as.data.frame(t(a)), as.data.frame(t(b))))
> >
>
> Ah, thank you so much. I'll take the generalization to N arguments
> ? la mapply() as an exercise for the reader.
>
> > 3. The code for the example in this post could be simplified to:
> >
> > first.1 <- apply(cbind(goldstandard, 1), 1, which.max)
> > ifelse(col(newtest) > first.1, NA, newtest)
> >
>
> Ouch! Consider this scholar slapped.
>
> > 4. given that both examples did not inherently need row by row
> operations
> > I wonder if that is the wrong generalization in the first place?
> >
>
> Given that you managed to squeeze my 20 lines of code into 2 lines
> AND that row.apply() does not exist in base without many people
> missing it, I'll have to concede this point and eliminate the
> craving for row.apply() in favour of the whole-object approach.
>
>
>
> ------------------------------
>
> Message: 23
> Date: Fri, 10 Aug 2007 13:52:18 +0000 (GMT)
> From: Jabez Wilson <jabezwuk@yahoo.co.uk>
> Subject: Re: [R] Odp: having problems with factor()
> To: Petr PIKAL <petr.pikal@precheza.cz>
> Cc: R-Help <r-help@stat.math.ethz.ch>
> Message-ID: <396309.57812.qm@web27408.mail.ukl.yahoo.com>
> Content-Type: text/plain
>
> You've spotted it!
>
> table(df$area)
> 0 1 2 3 4 5 7
> 21 27 71 46 19 3 1
>
> There are no values in area 6.
>
> Thank you very much.
>
> Jabez
>
>
> ----- Original Message ----
> From: Petr PIKAL <petr.pikal@precheza.cz>
> To: Jabez Wilson <jabezwuk@yahoo.co.uk>
> Cc: R-Help <r-help@stat.math.ethz.ch>
> Sent: Friday, 10 August, 2007 1:02:21 PM
> Subject: Odp: [R] having problems with factor()
>
>
> Hi
> r-help-bounces@stat.math.ethz.ch napsal dne 10.08.2007 13:41:53:
>
> > Dear R Help,
> > I have a set of data of heights of trees described by area that they
are
> in.
> > The areas are numerical (0 to 7).
> >
> > ht area
> > 1 320 3
> > 2 410 4
> > 3 230 2
> > 4 360 3
> > 5 126 1
> > 6 280 2
> > 7 260 2
> > 8 280 2
> > 9 280 2
> > 10 260 2
> > .......
> > 180 450 4
> > 181 90 1
> > 182 120 1
> > 183 440 4
> > 184 210 2
> > 185 330 3
> > 186 210 2
> > 187 100 1
> > 188 0 0
> >
> > I want to convert the area column values to factors, to do an anova.
> However, if I use:
> >
> > df$areaf <- factor(df$area,
>
labels=c("0","I","II","III","IV","V","VI","VII"))
> >
> > it gives the following message:
> >
>
> Hm, maybe some of the values are missing
>
> > num<-sample(1:3, 10, replace=T)
> > num
> [1] 1 3 1 2 3 3 1 3 3 3
> > factor(num, labels=c("O", "I", "II"))
> [1] O II O I II II O II II II
> Levels: O I II
>
> > factor(num, labels=c("O", "I", "II",
"III"))
> Error in factor(num, labels = c("O", "I",
"II", "III")) :
> invalid labels; length 4 should be 1 or 3
> >
>
> try
>
> table(df$area)
> to see what level you really have
>
> Regards
> Petr
>
>
> > Error in factor(df$area, labels = c("0", "I",
"II", "III", "IV", "V",
> "VI", :
> > invalid labels; length 8 should be 1 or 7
> >
> > Can anyone help?
> >
> > Jabez
> >
> >
> > ___________________________________________________________
> >
> > now.
> >
> > [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-help@stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
>
> ___________________________________________________________
>
> now.
>
> [[alternative HTML version deleted]]
>
>
>
> ------------------------------
>
> Message: 24
> Date: Fri, 10 Aug 2007 08:28:07 -0600
> From: "Greg Snow" <Greg.Snow@intermountainmail.org>
> Subject: Re: [R] Plot legend in margin
> To: "Daniel Brewer" <daniel.brewer@icr.ac.uk>, "Lauri
Nikkinen"
> <lauri.nikkinen@iki.fi>, r-help@stat.math.ethz.ch
> Message-ID:
>
<07E228A5BE53C24CAD490193A7381BBBB2F677@LP-EXCHVS07.CO.IHC.COM>
> Content-Type: text/plain; charset=us-ascii
>
> Another couple of things to think about:
>
> You could use the layout function to set up your multiple plots and
> include an extra plotting area at the bottom to place the legend in.
>
> If you stick with the solution below then the cnvrt.coords function from
> the TeachingDemos package may be useful (will help you find the
> coordinates relative to the last plot).
>
> Hope this helps,
>
> --
> Gregory (Greg) L. Snow Ph.D.
> Statistical Data Center
> Intermountain Healthcare
> greg.snow@intermountainmail.org
> (801) 408-8111
>
>
>
> > -----Original Message-----
> > From: r-help-bounces@stat.math.ethz.ch
> > [mailto:r-help-bounces@stat.math.ethz.ch] On Behalf Of Daniel Brewer
> > Sent: Friday, August 10, 2007 4:55 AM
> > To: Lauri Nikkinen; r-help@stat.math.ethz.ch
> > Subject: Re: [R] Plot legend in margin
> >
> > Thanks. That got me onto the right track. Because it is a
> > multiplot and I wanted it along the bottom, I found that I
> > had to use par(xpd=NA) and then position it relative to the
> > last of the multiplots. After a bit of trial and error I got there.
> >
> > Thanks
> >
> > Lauri Nikkinen wrote:
> > > Very simple example:
> > >
> > > opar <- par(mar = c(10, 4, 4, 4))
> > > plot(1:10)
> > > lines(1:10)
> > > par(xpd=TRUE)
> > > legend(4,-1.5,lty=1, col="black", legend="straigh
line")
> > > par(opar)
> > >
> > > -Lauri
> >
> > --
> > **************************************************************
> > Daniel Brewer, Ph.D.
> > Institute of Cancer Research
> > Email: daniel.brewer@icr.ac.uk
> > **************************************************************
> >
> > The Institute of Cancer Research: Royal Cancer Hospital, a
> > charitable Company Limited by Guarantee, Registered in
> > England under Company No. 534147 with its Registered Office
> > at 123 Old Brompton Road, London SW7 3RP.
> >
> > This e-mail message is confidential and for use by the\ >
...{{dropped}}
>
>
>
> ------------------------------
>
> Message: 25
> Date: Fri, 10 Aug 2007 10:28:25 -0400
> From: Roland Rau <roland.rproject@gmail.com>
> Subject: Re: [R] Seasonality
> To: Alberto Monteiro <albmont@centroin.com.br>
> Cc: r-help@stat.math.ethz.ch
> Message-ID: <46BC7609.4020906@gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Alberto Monteiro wrote:
> > I have a time series x = f(t), where t is taken for each
> > month. What is the best function to detect if _x_ has a seasonal
> > variation? If there is such seasonal effect, what is the
> > best function to estimate it?
> >
> From my own experience, I had the impression that there is nothing like
> a best approach to estimate the seasonal component of time series data.
>
> Maybe it is possible for you to simulate the assumed nature of your data
> (variable trend? variable seasonal pattern? count data with
> overdispersion? maybe a bimodal pattern every year?) and then try
> various of these methods and check if they can extract your input
> approximately correctly?
>
> Best,
> Roland
>
>
>
> ------------------------------
>
> Message: 26
> Date: Fri, 10 Aug 2007 10:47:49 -0400
> From: Fran?ois Pinard <pinard@iro.umontreal.ca>
> Subject: Re: [R] help with counting how many times each value occur in
> each column
> To: Tom Cohen <tom.cohen78@yahoo.se>
> Cc: r-help@stat.math.ethz.ch
> Message-ID: <20070810144749.GA5766@phenix.progiciels-bpi.ca>
> Content-Type: text/plain; charset=iso-8859-1; format=flowed
>
> [Tom Cohen]
>
> > I have the following dataset and want to know how many times each
value
> occur in each column.
>
> > >data
> > [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
> > [1,] -100 -100 -100 0 0 0 0 0 0 -100
> > [2,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> > [3,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> > [4,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> > [5,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -50
> > [6,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> > [7,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> > [8,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> > [9,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> >[10,] -100 -100 -100 -50 -100 -100 -100 -100 -100 -100
> >[11,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> >[12,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> >[13,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> >[14,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> >[15,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> >[16,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> >[17,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> >[18,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> >[19,] -100 -100 -100 0 0 0 0 0 0 -100
> >[20,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> > The result matrix should look like
> > -100 0 -50
> >[1] 20
> >[2] 20
> >[3] 20
> >[4] 17
> >[5] 18
> >[6] 18
> >[7] 18 and so on
> >[8]
> >[9]
> >[10]
>
> Presuming that "data" is a matrix, one could try a sequence like
this:
>
> dataf <- factor(data)
> dim(dataf) <- dim(data)
> result <- t(apply(dataf, 2, tabulate, nlevels(dataf)))
> colnames(result) <- levels(dataf)
> result
>
> If you want the columns sorted, you might decide the order of the levels
> on the "factor()" call, or explicitly reorder columns afterwards.
>
> --
> Fran?ois Pinard http://pinard.progiciels-bpi.ca
>
>
>
> ------------------------------
>
> Message: 27
> Date: Fri, 10 Aug 2007 14:47:45 +0200
> From: "Gasper Cankar" <gcanka@guest.arnes.si>
> Subject: Re: [R] help with counting how many times each value occur in
> eachcolumn
> To: <r-help@stat.math.ethz.ch>
> Message-ID: <001301c7db4c$a699c040$5200a8c0@ric.si>
> Content-Type: text/plain; charset="ISO-8859-1"
>
>
> Tom,
>
> If all values (-100,0,-50) would be in every column then simple
>
> apply(data,2,table)
>
> would work. Even if there aren0t all values in every column you could
> correct that and insert additional lines with all values for all columns
> like
>
> data <- cbind(data,matrix(ncol=10,nrow=3,rep(c(-100,0,-50),10)))
>
> and then do
>
> apply(data,2,table)-1
>
> to get correct results. But someone on a list can probably make much more
> elegant solution.
>
> Bye,
>
> Gasper Cankar, PhD
> Researcher
> National Examinations Centre
> Slovenia
>
> -----Original Message-----
> From: Tom Cohen [mailto:tom.cohen78@yahoo.se]
> Sent: Friday, August 10, 2007 2:02 PM
> To: r-help@stat.math.ethz.ch
> Subject: [R] help with counting how many times each value occur in
> eachcolumn
>
> Dear list,
> I have the following dataset and want to know how many times each value
> occur in each column.
> >data
> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
> [1,] -100 -100 -100 0 0 0 0 0 0 -100
> [2,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> [3,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> [4,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> [5,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -50
> [6,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> [7,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> [8,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> [9,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> [10,] -100 -100 -100 -50 -100 -100 -100 -100 -100 -100
> [11,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> [12,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> [13,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> [14,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> [15,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> [16,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> [17,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> [18,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> [19,] -100 -100 -100 0 0 0 0 0 0 -100
> [20,] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
> The result matrix should look like
> -100 0 -50
> [1] 20
> [2] 20
> [3] 20
> [4] 17
> [5] 18
> [6] 18
> [7] 18 and so on
> [8]
> [9]
> [10]
>
> How can I do this in R ?
> Thanks alot for your help,
> Tom
>
>
> ---------------------------------
>
> J?mf?r pris p? flygbiljetter och hotellrum:
> http://shopping.yahoo.se/c-169901-resor-biljetter.html
> [[alternative HTML version deleted]]
>
>
>
> ------------------------------
>
> Message: 28
> Date: Fri, 10 Aug 2007 10:57:50 -0400
> From: Fran?ois Pinard <pinard@iro.umontreal.ca>
> Subject: Re: [R] help with counting how many times each value occur in
> each column
> To: Gabor Grothendieck <ggrothendieck@gmail.com>
> Cc: r-help@stat.math.ethz.ch, Tom Cohen <tom.cohen78@yahoo.se>
> Message-ID: <20070810145750.GB5766@phenix.progiciels-bpi.ca>
> Content-Type: text/plain; charset=iso-8859-1; format=flowed
>
> [Gabor Grothendieck]
>
> > table(col(mat), mat)
>
> Clever, simple, and elegant! :-)
>
> --
> Fran?ois Pinard http://pinard.progiciels-bpi.ca
>
>
>
> ------------------------------
>
> Message: 29
> Date: Fri, 10 Aug 2007 11:17:57 -0400
> From: "Eric Turkheimer" <ent3c@virginia.edu>
> Subject: [R] rfImpute
> To: r-help@stat.math.ethz.ch
> Message-ID:
> <a42e7d400708100817v4eef5495o8b9e1c925d4720d7@mail.gmail.com>
> Content-Type: text/plain
>
> I am having trouble with the rfImpute function in the randomForest
> package.
> Here is a sample...
>
> clunk.roughfix<-na.roughfix(clunk)
> >
> > clunk.impute<-rfImpute(CONVERT~.,data=clunk)
> ntree OOB 1 2
> 300: 26.80% 3.83% 85.37%
> ntree OOB 1 2
> 300: 18.56% 5.74% 51.22%
> Error in randomForest.default(xf, y, ntree = ntree, ..., do.trace = ntree,
> :
> NA not permitted in predictors
>
> So roughFix works, but rfImpute doesn't....
>
> Thanks,
> Eric
> ent3c *at* virginia.edu
>
> --
> Eric Turkheimer, PhD
> Department of Psychology
> University of Virginia
> PO Box 400400
> Charlottesville, VA 22904-4400
>
> 434-982-4732
> 434-982-4766 (FAX)
>
> [[alternative HTML version deleted]]
>
>
>
> ------------------------------
>
> Message: 30
> Date: Fri, 10 Aug 2007 11:18:38 -0400
> From: "Rose Hoberman" <roseh@cs.cmu.edu>
> Subject: [R] smoothing function for proportions
> To: r-help@stat.math.ethz.ch
> Message-ID:
> <64c985560708100818w1d78e72ftfc11a3e8916f0b@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> I am looking for a function that can fit a smooth function to a vector
> of estimated proportions, such that the smoothed value is within
> specified confidence bounds of each proportion. In other words, given
> a small number of trials and large confidence intervals, I would
> prefer the function to vary smoothly, but given a large number of
> trials and small confidence intervals, I would prefer the function to
> lie within the confidence intervals, even if it is not smooth.
>
> I have attached a postscript file illustrating a data set I would like
> to smooth. As the figure shows, for large values of x, I have few
> data points, and so the ML estimate of the proportion varies widely,
> and the confidence intervals are very large. When I use the
> smooth.spline function with a large value of spar (the red line), the
> function is not as smooth as desired for large values of x. When I
> use a smaller value of spar (the green line), the function fails to
> stay within the confidence bounds of the proportions. Is there a
> smoothing function for which I can specify upper and lower limits for
> the y value for specific values of x?
>
> Thanks for any suggestions,
>
> Rose
>
>
>
> ------------------------------
>
> Message: 31
> Date: Fri, 10 Aug 2007 11:23:09 -0400
> From: "Rose Hoberman" <roseh@cs.cmu.edu>
> Subject: Re: [R] smoothing function for proportions
> To: r-help@stat.math.ethz.ch
> Message-ID:
> <64c985560708100823h35e041a4i6301b8ee8f2917dd@mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Sorry, forgot to attach the graph.
>
> On 8/10/07, Rose Hoberman <roseh@cs.cmu.edu> wrote:
> > I am looking for a function that can fit a smooth function to a vector
> > of estimated proportions, such that the smoothed value is within
> > specified confidence bounds of each proportion. In other words, given
> > a small number of trials and large confidence intervals, I would
> > prefer the function to vary smoothly, but given a large number of
> > trials and small confidence intervals, I would prefer the function to
> > lie within the confidence intervals, even if it is not smooth.
> >
> > I have attached a postscript file illustrating a data set I would like
> > to smooth. As the figure shows, for large values of x, I have few
> > data points, and so the ML estimate of the proportion varies widely,
> > and the confidence intervals are very large. When I use the
> > smooth.spline function with a large value of spar (the red line), the
> > function is not as smooth as desired for large values of x. When I
> > use a smaller value of spar (the green line), the function fails to
> > stay within the confidence bounds of the proportions. Is there a
> > smoothing function for which I can specify upper and lower limits for
> > the y value for specific values of x?
> >
> > Thanks for any suggestions,
> >
> > Rose
> >
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: smoothProportions.ps
> Type: application/postscript
> Size: 11419 bytes
> Desc: not available
> Url :
>
https://stat.ethz.ch/pipermail/r-help/attachments/20070810/09031ae4/attachment-0001.ps
>
> ------------------------------
>
> Message: 32
> Date: Fri, 10 Aug 2007 09:30:42 -0600
> From: "Greg Snow" <Greg.Snow@intermountainmail.org>
> Subject: Re: [R] how to include bar values in a barplot?
> To: "Donatas G." <dgvirtual@akl.lt>,
r-help@stat.math.ethz.ch
> Message-ID:
>
<07E228A5BE53C24CAD490193A7381BBBB2F698@LP-EXCHVS07.CO.IHC.COM>
> Content-Type: text/plain; charset=us-ascii
>
> Welcome to the world of R.
>
> I'm glad that you found the discussion enlightening, now that you have
> thought about things a bit, here is some code to try out that shows some
> of the alternatives to the original plots you provided (which is best
> depends on your audience and what your main question of interest is
> (which comparisons are most important):
>
> tmp <- c(34,22,77)
>
> tmp2 <- barplot(tmp, names=LETTERS[1:3])
>
> # put numbers at bottom of bars
> axis(1, at=tmp2, labels=as.character(tmp), tick=FALSE, line = -1)
>
> # put numbers at top of plot
> axis(3, at=tmp2, labels=as.character(tmp), tick=FALSE)
>
>
> # horizontal boxplot
>
> op <- par(mar=c(5,6,4,6)+0.1)
> tmp2 <- barplot(tmp, names=LETTERS[1:3], horiz=TRUE)
>
> # put numbers on the right
> axis(4, at=tmp2, labels=as.character(tmp), tick=FALSE, las=1)
>
> par(op)
>
> # the dotplot
> library(Hmisc)
> dotchart2(tmp, labels=LETTERS[1:3], auxdata=tmp, xlim=range(0,tmp))
>
>
> # alternatives to stacked bars
>
> tmp1 <- c(8, 22, 60, 10, 10, 21, 59, 10)
> tmp2 <- factor(rep(c('A','B'), each=4))
> tmp3 <- factor(rep(1:4, 2))
>
> dotchart2(tmp1, groups=tmp2, labels=tmp3, xlim=range(0,tmp1))
> dotchart2(tmp1, groups=tmp3, labels=tmp2, xlim=range(0,tmp1))
>
> library(lattice)
> tmp <- data.frame( tmp1=tmp1, tmp2=tmp2, tmp3=tmp3 )
>
> dotplot( tmp2~tmp1, data=tmp, groups=tmp3, pch=levels(tmp3),
> scales=list(x=list(limits=range(0,tmp1))) )
> dotplot( tmp3~tmp1, data=tmp, groups=tmp2, pch=levels(tmp2),
> xlim=range(0,tmp1) )
>
>
>
>
>
> --
> Gregory (Greg) L. Snow Ph.D.
> Statistical Data Center
> Intermountain Healthcare
> greg.snow@intermountainmail.org
> (801) 408-8111
>
>
>
> > -----Original Message-----
> > From: r-help-bounces@stat.math.ethz.ch
> > [mailto:r-help-bounces@stat.math.ethz.ch] On Behalf Of Donatas G.
> > Sent: Friday, August 10, 2007 2:15 AM
> > To: r-help@stat.math.ethz.ch
> > Subject: Re: [R] how to include bar values in a barplot?
> >
> > Quoting Greg Snow <Greg.Snow@intermountainmail.org>:
> >
> > > My original intent was to get the original posters out of
> > the mode of
> > > thinking they want to match what the spreadsheet does and into
> > > thinking about what message they are trying to get across. To
get
> > > them (and possibly others) thinking I made the statements a
> > bit more
> > > bold than my actual position (I did include a couple of
qualifiers).
> >
> > As an original poster (and a brand new user of R), I would
> > like to comment on the educational experience I have just received. ;)
> >
> > The discussion was interesting and enlightening, and gives
> > some good ideas about the ways (tables, graphs, graphs with
> > numbers etc.) to get the data accross to the ones one is
> > presenting to. I see some of you guys do feel quite strongly
> > about it, which is fine for me. I do not. I usually care for
> > barplot aesthetics and informativeness more than for visual
> > simplicity. That may change in time :)
> >
> > I see R graphical capabilities are huge but hard to access at
> > times - that is when spreadsheet seems preferrable. For
> > example, as a user of Linux I still cannot figure out why the
> > fonts (and graphics in general) look much more ugly on R in
> > Linux than they do in R on Windows - no smoothing, sub-pixell
> > hinting, anything like that. That is what my next free time
> > homework on R will be about
> > :)
> >
> > Sincerely
> >
> > Donatas Glodenis
> > PhD candidate
> > Department of Sociology of the Faculty of Philosophy Vilnius
> > University Lithuania
> >
> > ______________________________________________
> > R-help@stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> > http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >
>
>
>
> ------------------------------
>
> Message: 33
> Date: Fri, 10 Aug 2007 11:37:30 -0400
> From: "Weiwei Shi" <helprhelp@gmail.com>
> Subject: Re: [R] a question on lda{MASS}
> To: "r-help@stat.math.ethz.ch" <R-help@stat.math.ethz.ch>
> Message-ID:
> <cdf817830708100837s444bd626g422844e24fd29460@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> hi,
>
> maybe I should re-phrase my question a bit:
>
> is there a way to get explicit formulae like Y ~ sum of CiXi from the
> model build by lda{MASS} to calculate $x (value) ?
>
> I assume scaling is the coeff and Xi is from test data and Y is $x
> called LD1. But I want to confirm this.
>
> Thanks.
>
> Weiwei
>
> On 8/9/07, Weiwei Shi <helprhelp@gmail.com> wrote:
> > hi,
> >
> > assume
> > val is the test data while m is lda model value by using CV=F
> >
> > x = predict(m, val)
> >
> > val2 = val[, 1:(ncol(val)-1)] # the last column is class label
> >
> > # col is sample, row is variable
> >
> > then I am wondering if
> >
> > x$x == (apply(val2*m$scaling), 2, sum)
> >
> > i.e., the scaling (is it coeff vector?) times val data and sum is the
> > discrimant result $x?
> >
> > Thanks.
> >
> > --
> > Weiwei Shi, Ph.D
> > Research Scientist
> > GeneGO, Inc.
> >
> > "Did you always know?"
> > "No, I did not. But I believed..."
> > ---Matrix III
> >
>
>
> --
> Weiwei Shi, Ph.D
> Research Scientist
> GeneGO, Inc.
>
> "Did you always know?"
> "No, I did not. But I believed..."
> ---Matrix III
>
>
>
> ------------------------------
>
> Message: 34
> Date: Fri, 10 Aug 2007 09:46:52 -0600
> From: "Greg Snow" <Greg.Snow@intermountainmail.org>
> Subject: Re: [R] Subject: Re: how to include bar values in a barplot?
> To: "Jim Lemon" <jim@bitwrit.com.au>, "Gabor
Grothendieck"
> <ggrothendieck@gmail.com>
> Cc: r-help@stat.math.ethz.ch
> Message-ID:
>
<07E228A5BE53C24CAD490193A7381BBBB2F6A2@LP-EXCHVS07.CO.IHC.COM>
> Content-Type: text/plain; charset=us-ascii
>
>
>
> Jim Lemon Wrote:
>
> > I also greatly enjoyed Ted's rebuttal of the "Bar charts are
> > evil and must be banned" argument. If bar charts are
> > appropriate for the audience, give 'em bar charts. One great
> > way to turn off your customers is to tell them what they can
> > and can't do with your product.
>
> I don't remember anyone saying that barcharts are evil or that they
> should be banned (3-D bar charts and pie charts on the other hand ...).
>
> I think that a variation on fortune(108) applies here. While barcharts
> may be appropriate for some audiences, it is also appropriate to educate
> our audiences to better alternatives.
>
>
> --
> Gregory (Greg) L. Snow Ph.D.
> Statistical Data Center
> Intermountain Healthcare
> greg.snow@intermountainmail.org
> (801) 408-8111
>
>
>
> ------------------------------
>
> Message: 35
> Date: Fri, 10 Aug 2007 10:51:42 -0500
> From: roger koenker <rkoenker@uiuc.edu>
> Subject: Re: [R] smoothing function for proportions
> To: roseh@cs.cmu.edu
> Cc: r-help@stat.math.ethz.ch
> Message-ID: <C151C902-F6E5-45C4-A2F7-85D07856393F@uiuc.edu>
> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
>
> It is not entirely clear what you are using for y values in
> smooth.spline,
> but it would appear that it is just the point estimates. I would
> suggest
> using instead -- at each x value -- a few equally spaced quantiles of
> the estimated proportions. Implicitly, smooth.spline expects to be
> fitting
> a mean curve to data that has constant variance, so you might also
> consider reweighting to approximate this, as well.
>
>
> url: www.econ.uiuc.edu/~roger Roger Koenker
> email rkoenker@uiuc.edu Department of Economics
> vox: 217-333-4558 University of Illinois
> fax: 217-244-6678 Champaign, IL 61820
>
>
> On Aug 10, 2007, at 10:23 AM, Rose Hoberman wrote:
>
> > Sorry, forgot to attach the graph.
> >
> > On 8/10/07, Rose Hoberman <roseh@cs.cmu.edu> wrote:
> >> I am looking for a function that can fit a smooth function to a
> >> vector
> >> of estimated proportions, such that the smoothed value is within
> >> specified confidence bounds of each proportion. In other words,
> >> given
> >> a small number of trials and large confidence intervals, I would
> >> prefer the function to vary smoothly, but given a large number of
> >> trials and small confidence intervals, I would prefer the function
to
> >> lie within the confidence intervals, even if it is not smooth.
> >>
> >> I have attached a postscript file illustrating a data set I would
> >> like
> >> to smooth. As the figure shows, for large values of x, I have few
> >> data points, and so the ML estimate of the proportion varies
widely,
> >> and the confidence intervals are very large. When I use the
> >> smooth.spline function with a large value of spar (the red line),
the
> >> function is not as smooth as desired for large values of x. When
I
> >> use a smaller value of spar (the green line), the function fails
to
> >> stay within the confidence bounds of the proportions. Is there a
> >> smoothing function for which I can specify upper and lower limits
for
> >> the y value for specific values of x?
> >>
> >> Thanks for any suggestions,
> >>
> >> Rose
> >>
> >> <smoothProportions.ps>
> > ______________________________________________
> > R-help@stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide http://www.R-project.org/posting-
> > guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
>
>
> ------------------------------
>
> Message: 36
> Date: Fri, 10 Aug 2007 16:26:29 +0000
> From: laran gines <larangines@hotmail.com>
> Subject: [R] GLM with tweedie: NA for AIC
> To: <r-help@stat.math.ethz.ch>
> Message-ID: <BAY110-W13908E5B3D08A6B034E36C9E10@phx.gbl>
> Content-Type: text/plain
>
> Dear R users;
>
> I am modelling densities of some species of birds, so I have a problem
> with a great ammount of zeros.
> I have decided to try GLMs with the tweedie family, but in all the models
> I have tried I got an NA for the AIC value.
> Just to check the problem I've compared the a glm using the Gaussian
> family with the identity link and a glm using the tweedie family with
> var.power=0 and link.power=1. These are equal, as expected, except the
> fact that the tweedie output gives me an NA for the AIC.
> Can anyone help me with this problem?
> Below you can find the two outputs I refer.
>
> Best Wishes;
>
> Catarina
>
> > summary(glm(formula=ACIN~DIST_REF+DIST_H2O+DIST_OST+
> COTA+H2O_SUP+vasa,family=gaussian(link="identity")))
> Call:glm(formula = ACIN ~ DIST_REF + DIST_H2O + DIST_OST + COTA +
> H2O_SUP + vasa, family = gaussian(link = "identity"))
> Deviance Residuals: Min 1Q Median
> 3Q Max -0.112792 -0.042860 -0.021113 -0.006311 1.551824
> Coefficients: Estimate Std. Error t value
> Pr(>|t|) (Intercept) -6.625e-02 5.454e-02 -1.215 0.2256 DIST_REF
> 3.581e-06 1.336e-05 0.268 0.7889 DIST_H2O -3.168e-05 1.527e-05
> -2.074 0.0391 *DIST_OST -1.799e-05 1.953e-05 -0.921 0.3579 COTA
> 5.648e-04 2.470e-04 2.287 0.0230 *H2O_SUP -2.172e-04 3.994e-04
> -0.544 0.5870 vasa 3.695e-02 4.573e-02 0.808 0.4199
---Signif.
> codes: 0 '***' 0.001 '**' 0.01 '*' 0.05
'.' 0.1 ' ' 1
> (Dispersion parameter for gaussian family taken to be 0.02151985)
> Null deviance: 5.6028 on 257 degrees of freedomResidual deviance:
> 5.4015 on 251 degrees of freedomAIC: -249.33
> Number of Fisher Scoring iterations: 2
>
>
> > summary(glm(formula=ACIN~DIST_REF+DIST_H2O+DIST_OST+
> COTA+H2O_SUP+vasa,control=glm.control(maxit=750),family=tweedie(
> var.power=0, link.power=1)))
> Call:glm(formula = ACIN ~ DIST_REF + DIST_H2O + DIST_OST + COTA +
> H2O_SUP + vasa, family = tweedie(var.power = 0, link.power = 1),
> control = glm.control(maxit = 750))
> Deviance Residuals: Min 1Q Median
> 3Q Max -0.112792 -0.042860 -0.021113 -0.006311 1.551824
> Coefficients: Estimate Std. Error t value
> Pr(>|t|) (Intercept) -6.625e-02 5.454e-02 -1.215 0.2256 DIST_REF
> 3.581e-06 1.336e-05 0.268 0.7889 DIST_H2O -3.168e-05 1.527e-05
> -2.074 0.0391 *DIST_OST -1.799e-05 1.953e-05 -0.921 0.3579 COTA
> 5.648e-04 2.470e-04 2.287 0.0230 *H2O_SUP -2.172e-04 3.994e-04
> -0.544 0.5870 vasa 3.695e-02 4.573e-02 0.808 0.4199
---Signif.
> codes: 0 '***' 0.001 '**' 0.01 '*' 0.05
'.' 0.1 ' ' 1
> (Dispersion parameter for Tweedie family taken to be 0.02151985)
> Null deviance: 5.6028 on 257 degrees of freedomResidual deviance:
> 5.4015 on 251 degrees of freedomAIC: NA
> Number of Fisher Scoring iterations: 2
>
> _________________________________________________________________
> Conheça o Windows Live Spaces, a rede de relacionamentos conectada ao
> Messenger!
>
> [[alternative HTML version deleted]]
>
>
>
> ------------------------------
>
> Message: 37
> Date: Thu, 9 Aug 2007 21:56:24 -0700
> From: "Nordlund, Dan (DSHS/RDA)" <NordlDJ@dshs.wa.gov>
> Subject: [R] Test (ignore)
> To: r-help@stat.math.ethz.ch
> Message-ID:
>
<941871A13165C2418EC144ACB212BDB04E1354@dshsmxoly1504g.dshs.wa.lcl
> >
> Content-Type: text/plain; charset=utf-8
>
>
>
> Daniel J. Nordlund
> Research and Data Analysis
> Washington State Department of Social and Health Services
> Olympia, WA 98504-5204
>
>
>
> ------------------------------
>
> Message: 38
> Date: Fri, 10 Aug 2007 10:35:23 -0600
> From: "Emilio Gagliardi" <emilio@ualberta.ca>
> Subject: Re: [R] Help using gPath
> To: "Paul Murrell" <paul@stat.auckland.ac.nz>
> Cc: General R-Help <r-help@stat.math.ethz.ch>
> Message-ID:
> <3a9ebf340708100935m43ff3eabp942c49a444387169@mail.gmail.com>
> Content-Type: text/plain
>
> haha Paul,
>
>
> It's important not only to post code, but also to make sure that other
> > people can run it (i.e., include real data or have the code generate
> > data or use one of R's predefined data sets).
>
>
> Oh, I hadn't thought of using the predefined datasets, thats a good
idea!
>
> Also, isn't this "next time" ? :)
>
>
> By next time I meant, when I ask a question in the future, I didn't
think
> you'd respond!
>
> So here is some code!
>
> library(reshape)
> library(ggplot2)
>
> theme_t <-
list(grid.fill="white",grid.colour="lightgrey",
> background.colour> "black",axis.colour="dimgrey")
> ggtheme(theme_t)
>
> grp <-
>
>
c(2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3)
> time <-
>
>
c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2)
> cc <- c(0.7271,0.7563,0.6979,0.8208,0.7521,0.7875,0.7563,0.7771,0.8208,
> 0.7938,0.8083,0.7188,0.7521,0.7854,0.7979,0.7583,0.7646,0.6938,0.6813,
> 0.7708
> ,0.7375,0.8104,0.8104,0.7792,0.7833,0.8083,0.8021,0.7313,0.7958,0.7021,
> 0.8167,0.8167,0.7583,0.7167,0.6563,0.6896,0.7333,0.8208,0.7396,0.8063,
> 0.7083
> ,0.6708,0.7292,0.7646,0.7667,0.775,0.8021,0.8125,0.7646,0.6917,0.7458,
> 0.7833
> ,0.7396,0.7229,0.7708,0.7729,0.8083,0.7771,0.6854,0.8417,0.7667,0.7063,
> 0.75,
> 0.7813,0.8271,0.7896,0.7979,0.625,0.7938,0.7583,0.7396,0.7583,0.7938,
> 0.7333,
> 0.7875,0.8146)
>
> data <- as.data.frame(cbind(time,grp,cc))
> data$grp <- factor(data$grp,labels=c("Group A","Group
B"))
> data$time <-
factor(data$time,labels=c("Pre-test","Post-test"))
> boxplot <- qplot(grp, cc, data=data, geom="boxplot",
> orientation="horizontal", ylim=c(0.5,1), main="Hello
World!", xlab="Label
> X", ylab="Label Y", facets=.~time, colour="red",
size=2)
> boxplot + geom_jitter(aes(colour="steelblue")) +
scale_colour_identity() +
> scale_size_identity()
> grid.gedit("ylabel", gp=gpar(fontsize=16))
>
>
> > There's a book that provides a full explanation and the (basic)
grid
> > chapter is online (see
> > http://www.stat.auckland.ac.nz/~paul/RGraphics/rgraphics.html)
>
>
> Awesome, I'll check that out.
>
> Yep, the facilities for investigating the viewport and grob tree are
> > basically inadequate. Based on some work Hadley did for ggplot, the
> > development version of R has a slightly better tool called grid.ls()
> > that can show how the grob tree and the viewport tree intertwine.
That
> > would allow you to see which viewport each grob was drawn in, which
> > would help you, for example, to know which viewport you had to go to
to
> > replace a rectangle you want to remove.
>
>
> okie dokie, I'm ready to be amazed! hehe.
> emilio
>
> [[alternative HTML version deleted]]
>
>
>
> ------------------------------
>
> Message: 39
> Date: Fri, 10 Aug 2007 12:41:24 -0400
> From: "Weiwei Shi" <helprhelp@gmail.com>
> Subject: [R] write.table
> To: "r-help@stat.math.ethz.ch" <R-help@stat.math.ethz.ch>
> Message-ID:
> <cdf817830708100941n188c386as3c65fe3e6b7ca948@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hi,
>
> I am always with this qustion when I tried to write a data.frame with
> row.names and col.names. I have to re-make the data frame to let its
> first column be the rownames and let row.names=F so that I can align
> the colnames correctly.
>
> Is there a way or option in write.table to automatically do that?
>
> thanks.
>
> --
> Weiwei Shi, Ph.D
> Research Scientist
> GeneGO, Inc.
>
> "Did you always know?"
> "No, I did not. But I believed..."
> ---Matrix III
>
>
>
> ------------------------------
>
> Message: 40
> Date: Thu, 9 Aug 2007 12:59:16 -0700
> From: "Nordlund, Dan (DSHS/RDA)" <NordlDJ@dshs.wa.gov>
> Subject: Re: [R] small sample techniques
> To: r-help@stat.math.ethz.ch
> Message-ID:
>
<941871A13165C2418EC144ACB212BDB04E1350@dshsmxoly1504g.dshs.wa.lcl
> >
> Content-Type: text/plain; charset=iso-8859-1
>
> > -----Original Message-----
> > From: r-help-bounces@stat.math.ethz.ch
> > [mailto:r-help-bounces@stat.math.ethz.ch] On Behalf Of Nair,
> > Murlidharan T
> > Sent: Thursday, August 09, 2007 12:02 PM
> > To: Nordlund, Dan (DSHS/RDA); r-help@stat.math.ethz.ch
> > Subject: Re: [R] small sample techniques
> >
> > n=300
> > 30% taking A relief from pain
> > 23% taking B relief from pain
> > Question; If there is no difference are we likely to get a 7%
> > difference?
> >
> > Hypothesis
> > H0: p1-p2=0
> > H1: p1-p2!=0 (not equal to)
> >
> > 1>Weighed average of two sample proportion
> > 300(0.30)+300(0.23)
> > ------------------- = 0.265
> > 300+300
> > 2>Std Error estimate of the difference between two
> > independent proportions
> > sqrt((0.265 *0.735)*((1/300)+(1/300))) = 0.03603
> >
> > 3>Evaluation of the difference between sample proportion as a
> > deviation from the hypothesized difference of zero
> > ((0.30-0.23)-(0))/0.03603 = 1.94
> >
> >
> > z did not approach 1.96 hence H0 is not rejected.
> >
> > This is what I was trying to do using prop.test.
> >
> > prop.test(c(30,23),c(300,300))
> >
> > What function should I use?
> >
> >
>
> The proportion test above indicates that p1=0.1 and p2=0.07666667. But in
> your t-test you specify p1=0.3 and p2=0.23. Which is correct? If
p1=0.3and p2> 0.23, then use
>
> prop.test(c(.30*300,.23*300),c(300,300))
>
> Hope this is helpful,
>
> Dan
>
> Daniel J. Nordlund
> Research and Data Analysis
> Washington State Department of Social and Health Services
> Olympia, WA 98504-5204
>
>
>
> ------------------------------
>
> Message: 41
> Date: Thu, 9 Aug 2007 12:59:16 -0700
> From: "Nordlund, Dan (DSHS/RDA)" <NordlDJ@dshs.wa.gov>
> Subject: Re: [R] small sample techniques
> To: r-help@stat.math.ethz.ch
> Message-ID:
>
<941871A13165C2418EC144ACB212BDB04E1350@dshsmxoly1504g.dshs.wa.lcl
> >
> Content-Type: text/plain; charset=iso-8859-1
>
> > -----Original Message-----
> > From: r-help-bounces@stat.math.ethz.ch
> > [mailto:r-help-bounces@stat.math.ethz.ch] On Behalf Of Nair,
> > Murlidharan T
> > Sent: Thursday, August 09, 2007 12:02 PM
> > To: Nordlund, Dan (DSHS/RDA); r-help@stat.math.ethz.ch
> > Subject: Re: [R] small sample techniques
> >
> > n=300
> > 30% taking A relief from pain
> > 23% taking B relief from pain
> > Question; If there is no difference are we likely to get a 7%
> > difference?
> >
> > Hypothesis
> > H0: p1-p2=0
> > H1: p1-p2!=0 (not equal to)
> >
> > 1>Weighed average of two sample proportion
> > 300(0.30)+300(0.23)
> > ------------------- = 0.265
> > 300+300
> > 2>Std Error estimate of the difference between two
> > independent proportions
> > sqrt((0.265 *0.735)*((1/300)+(1/300))) = 0.03603
> >
> > 3>Evaluation of the difference between sample proportion as a
> > deviation from the hypothesized difference of zero
> > ((0.30-0.23)-(0))/0.03603 = 1.94
> >
> >
> > z did not approach 1.96 hence H0 is not rejected.
> >
> > This is what I was trying to do using prop.test.
> >
> > prop.test(c(30,23),c(300,300))
> >
> > What function should I use?
> >
> >
>
> The proportion test above indicates that p1=0.1 and p2=0.07666667. But in
> your t-test you specify p1=0.3 and p2=0.23. Which is correct? If
p1=0.3and p2> 0.23, then use
>
> prop.test(c(.30*300,.23*300),c(300,300))
>
> Hope this is helpful,
>
> Dan
>
> Daniel J. Nordlund
> Research and Data Analysis
> Washington State Department of Social and Health Services
> Olympia, WA 98504-5204
>
>
>
> ------------------------------
>
> Message: 42
> Date: Fri, 10 Aug 2007 17:00:34 +0000
> From: Monica Pisica <pisicandru@hotmail.com>
> Subject: [R] Cleaning up the memory
> To: <r-help@stat.math.ethz.ch>
> Message-ID: <BAY104-W14C5EC6532FFCAD5372821C3E10@phx.gbl>
> Content-Type: text/plain
>
>
> Hi,
>
> I have 4 huge tables on which i want to do a PCA analysis and a kmean
> clustering. If i run each table individually i have no problems, but if i
> want to run it in a for loop i exceed the memory alocation after the second
> table, even if i save the results as a csv table and i clean up all the big
> objects with rm command. To me it seems that even if i don't have the
> objects anymore, the memory these objects used to occupy is not cleared. Is
> there any way to clear up the memory as well? I don't want to close R
and
> start it up again. Also i am running R under Windows.
>
> thanks,
>
> Monica
> _________________________________________________________________
> [[trailing spam removed]]
>
> [[alternative HTML version deleted]]
>
>
>
> ------------------------------
>
> Message: 43
> Date: Fri, 10 Aug 2007 19:05:26 +0200
> From: "KOITA Lassana - STAC/ACE"
> <lassana.koita@aviation-civile.gouv.fr>
> Subject: [R] need help to manipulate function and time interval
> To: r-help@stat.math.ethz.ch
> Message-ID:
> <
>
OF757EAC49.8C2AD1F7-ONC1257333.005876DC-C1257333.005DC714@aviation-civile.gouv.fr
> >
>
> Content-Type: text/plain
>
> Hi R-users,
>
> I have to define a noise level function L and its energy in the various
> moment of the day by:
>
> if time is between 18:00:00 and 23:59:59 then L[j] <- L[j]+5 and W
<-
> 10^((L+5)/10)
>
> if time is between 22:00:00 and 05:59:59 ==> L <- L+10 and W <-
> 10^((L+10)/10)
> else
> L=L and W = W
>
> Could someone help me to realize this function please? You will find my
> following proposal code, but my main problem is to handle the time
> interval.
>
> Best regard
>
> ###########################
> myfunc <- function(mytab, Time, Level)
> {
> vect <- rep(0, length(mytab))
> for(i in 1:length(vect))
> {
> for(j in 1:length(Time))
>
> if(time[j] is between 18:00:00 and 23:59:59)
>
> L[i] <- L[j]+5
>
> vect[i] <- 10^((L[i])/10
>
> if (time[j] is between 22:00:00 and 05:59:59)
>
> L[i] <- L[j]+10
>
> vect[i] <- 10^((L[i])/10
>
> else
>
> L[i] = L[j]
>
> vect[i] <- 10^((L[i])/10
> }
> }
>
> #######################
>
> Lassana KOITA
> Chargé d'Etudes de Sécurité Aéroportuaire et d'Analyse Statistique
/
> Project Engineer Airport Safety Studies & Statistical analysis
> Service Technique de l'Aviation Civile (STAC) / Civil Aviation
Technical
> Department
> Direction Générale de l'Aviation Civile (DGAC) / French Civil Aviation
> Headquarters
> Tel: 01 49 56 80 60
> Fax: 01 49 56 82 14
> E-mail: Lassana.Koita@aviation-civile.gouv.fr
> http://www.stac.aviation-civile.gouv.fr/
> [[alternative HTML version deleted]]
>
>
>
> ------------------------------
>
> Message: 44
> Date: Fri, 10 Aug 2007 14:22:00 -0300
> From: "Henrique Dallazuanna" <wwwhsd@gmail.com>
> Subject: Re: [R] need help to manipulate function and time interval
> To: "KOITA Lassana - STAC/ACE"
<lassana.koita@aviation-civile.gouv.fr>
> Cc: r-help@stat.math.ethz.ch
> Message-ID:
> <da79af330708101022l6c2ef266sfd2913cfd55742de@mail.gmail.com>
> Content-Type: text/plain
>
> Hi,
>
> Try whit:
>
> if(time[j] >= "18:00:00" & < "23:59:59")
> ...
> ...
>
> --
> Henrique Dallazuanna
> Curitiba-Paraná-Brasil
> 25° 25' 40" S 49° 16' 22" O
>
> On 10/08/07, KOITA Lassana - STAC/ACE <
> lassana.koita@aviation-civile.gouv.fr>
> wrote:
> >
> > Hi R-users,
> >
> > I have to define a noise level function L and its energy in the
various
> > moment of the day by:
> >
> > if time is between 18:00:00 and 23:59:59 then L[j] <- L[j]+5 and W
<-
> > 10^((L+5)/10)
> >
> > if time is between 22:00:00 and 05:59:59 ==> L <- L+10 and W
<-
> > 10^((L+10)/10)
> > else
> > L=L and W = W
> >
> > Could someone help me to realize this function please? You will find
my
> > following proposal code, but my main problem is to handle the time
> > interval.
> >
> > Best regard
> >
> > ###########################
> > myfunc <- function(mytab, Time, Level)
> > {
> > vect <- rep(0, length(mytab))
> > for(i in 1:length(vect))
> > {
> > for(j in 1:length(Time))
> >
> > if(time[j] is between 18:00:00 and 23:59:59)
> >
> > L[i] <- L[j]+5
> >
> > vect[i] <- 10^((L[i])/10
> >
> > if (time[j] is between 22:00:00 and 05:59:59)
> >
> > L[i] <- L[j]+10
> >
> > vect[i] <- 10^((L[i])/10
> >
> > else
> >
> > L[i] = L[j]
> >
> > vect[i] <- 10^((L[i])/10
> > }
> > }
> >
> > #######################
> >
> > Lassana KOITA
> > Chargé d'Etudes de Sécurité Aéroportuaire et d'Analyse
Statistique /
> > Project Engineer Airport Safety Studies & Statistical analysis
> > Service Technique de l'Aviation Civile (STAC) / Civil Aviation
Technical
> > Department
> > Direction Générale de l'Aviation Civile (DGAC) / French Civil
Aviation
> > Headquarters
> > Tel: 01 49 56 80 60
> > Fax: 01 49 56 82 14
> > E-mail: Lassana.Koita@aviation-civile.gouv.fr
> > http://www.stac.aviation-civile.gouv.fr/
> > [[alternative HTML version deleted]]
> >
> >
> > ______________________________________________
> > R-help@stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> > http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >
> >
>
> [[alternative HTML version deleted]]
>
>
>
> ------------------------------
>
> Message: 45
> Date: Fri, 10 Aug 2007 18:28:07 +0100 (BST)
> From: Prof Brian Ripley <ripley@stats.ox.ac.uk>
> Subject: Re: [R] Cleaning up the memory
> To: Monica Pisica <pisicandru@hotmail.com>
> Cc: r-help@stat.math.ethz.ch
> Message-ID: <Pine.LNX.4.64.0708101822140.6256@gannet.stats.ox.ac.uk>
> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
>
> On Fri, 10 Aug 2007, Monica Pisica wrote:
>
> >
> > Hi,
> >
> > I have 4 huge tables on which i want to do a PCA analysis and a kmean
> > clustering. If i run each table individually i have no problems, but
if
> > i want to run it in a for loop i exceed the memory alocation after the
> > second table, even if i save the results as a csv table and i clean up
> > all the big objects with rm command. To me it seems that even if i
don't
> > have the objects anymore, the memory these objects used to occupy is
not
> > cleared. Is there any way to clear up the memory as well? I don't
want
> > to close R and start it up again. Also i am running R under Windows.
>
> See ?gc, which does the clearing.
>
> However, unless you study the memory allocation in detail (which you
> cannot do from R code), you don't actually know that this is the
problem.
> More likely is that you have fragmentation of your 32-bit address space:
> see ?"Memory-limits".
>
> Without any idea what memory you have and what 'huge' means, we can
only
> make wild guesses. It might be worth raising the memory limit (the
> --max-mem-size flag).
>
> >
> > thanks,
> >
> > Monica
> > _________________________________________________________________
> > [[trailing spam removed]]
> >
> > [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-help@stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >
>
> --
> Brian D. Ripley, ripley@stats.ox.ac.uk
> Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
> University of Oxford, Tel: +44 1865 272861 (self)
> 1 South Parks Road, +44 1865 272866 (PA)
> Oxford OX1 3TG, UK Fax: +44 1865 272595
>
>
>
> ------------------------------
>
> Message: 46
> Date: Fri, 10 Aug 2007 13:58:27 -0400
> From: "Yinghai Deng" <Yinghai.Deng@bri.nrc.ca>
> Subject: Re: [R] write.table
> To: "Weiwei Shi" <helprhelp@gmail.com>,
"r-help@stat.math.ethz.ch"
> <R-help@stat.math.ethz.ch>
> Message-ID: <KNEDKNFOAOJGKIMAMOMDKEKKCBAA.Yinghai.Deng@bri.nrc.ca>
> Content-Type: text/plain; charset="us-ascii"
>
> write.table(mydata.frame, "mydata", col.names=NA, quote=F,
sep="\t") will
> solve the problem.
> Deng
> -----Original Message-----
> From: r-help-bounces@stat.math.ethz.ch
> [mailto:r-help-bounces@stat.math.ethz.ch]On Behalf Of Weiwei Shi
> Sent: August 10, 2007 12:41 PM
> To: r-help@stat.math.ethz.ch
> Subject: [R] write.table
>
>
> Hi,
>
> I am always with this qustion when I tried to write a data.frame with
> row.names and col.names. I have to re-make the data frame to let its
> first column be the rownames and let row.names=F so that I can align
> the colnames correctly.
>
> Is there a way or option in write.table to automatically do that?
>
> thanks.
>
> --
> Weiwei Shi, Ph.D
> Research Scientist
> GeneGO, Inc.
>
> "Did you always know?"
> "No, I did not. But I believed..."
> ---Matrix III
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>
>
> ------------------------------
>
> Message: 47
> Date: Fri, 10 Aug 2007 14:05:50 -0400
> From: "Lanre Okusanya" <lanre.okusanya@gmail.com>
> Subject: [R] Help wit matrices
> To: "'r-help@stat.math.ethz.ch'"
<r-help@stat.math.ethz.ch>
> Message-ID:
> <6e25bb420708101105o17e80f36re816c031777e85c7@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hello all,
>
> I am working with a 1000x1000 matrix, and I would like to return a
> 1000x1000 matrix that tells me which value in the matrix is greater
> than a theshold value (1 or 0 indicator).
> i have tried
> mat2<-as.matrix(as.numeric(mat1>0.25))
> but that returns a 1:100000 matrix.
> I have also tried for loops, but they are grossly inefficient.
>
> THanks for all your help in advance.
>
> Lanre
>
>
>
> ------------------------------
>
> Message: 48
> Date: Fri, 10 Aug 2007 18:09:58 +0000
> From: Monica Pisica <pisicandru@hotmail.com>
> Subject: Re: [R] Cleaning up the memory
> To: Prof Brian Ripley <ripley@stats.ox.ac.uk>
> Cc: r-help@stat.math.ethz.ch
> Message-ID: <BAY104-W21EDAF4F804B3715CCF814C3E10@phx.gbl>
> Content-Type: text/plain
>
>
> Thanks! I will look into ...
>
> I have 4 GB RAM, and i was monitoring the memory with Windows task manager
> so i was looking how R "gets" more and more memory allocation
from less than
> 100Mb to .... 1500Mb .....
>
> My initial tables are between 30 to 80 Mb and the resulting tables that
> incorporate the initial tables plus PCA and kmeans results are inbetween 50
> to 200MB or thereabouts!
>
> And yes, i don't really care about memory allocation in detail - what i
> want is to free that memory after every cycle ;-)
>
> Although, after i didn't do anything in R and it was idle for more than
30
> min. the memory allocation according to Task manager dropped to 15 Mb .....
> which is good - but i cannot wait inbetween cycles half an hour though
.....
>
> Again thanks,
>
> Monica> Date: Fri, 10 Aug 2007 18:28:07 +0100> From:
ripley@stats.ox.ac.uk>
> To: pisicandru@hotmail.com> CC: r-help@stat.math.ethz.ch> Subject:
Re: [R]
> Cleaning up the memory> > On Fri, 10 Aug 2007, Monica Pisica
wrote:> > >> >
> Hi,> >> > I have 4 huge tables on which i want to do a PCA
analysis and a
> kmean > > clustering. If i run each table individually i have no
problems,
> but if > > i want to run it in a for loop i exceed the memory
alocation
> after the > > second table, even if i save the results as a csv table
and i
> clean up > > all the big objects with rm command. To me it seems that
even
> if i don't > > have the objects anymore, the memory these objects
used to
> occupy is not > > cleared. Is there any way to clear up the memory as
well?
> I don't want > > to close R and start it up again. Also i am
running R under
> Windows.> > See ?gc, which does the clearing.> > However,
unless you study
> the memory allocation in detail (which you > cannot do from R code), you
> don't actually !
> know that this is the problem. > More likely is that you have
> fragmentation of your 32-bit address space: > see
?"Memory-limits".> >
> Without any idea what memory you have and what 'huge' means, we can
only >
> make wild guesses. It might be worth raising the memory limit (the >
> --max-mem-size flag).> > >> > thanks,> >> >
Monica> >
> _________________________________________________________________> >
> [[trailing spam removed]]> >> > [[alternative HTML version
deleted]]> >> >
> ______________________________________________> >
R-help@stat.math.ethz.chmailing list> >
> https://stat.ethz.ch/mailman/listinfo/r-help> > PLEASE do read the
posting
> guide http://www.R-project.org/posting-guide.html> > and provide
> commented, minimal, self-contained, reproducible code.> >> > --
> Brian D.
> Ripley, ripley@stats.ox.ac.uk> Professor of Applied Statistics,
> http://www.stats.ox.ac.uk/~ripley/> University of Oxford, Tel: +44 1865
> 272861 (self)> 1 South Parks Road, +44 1865 272866 (PA)> Oxford OX1
3TG!
> , UK Fax: +44 1865 272595
> _________________________________________________________________
> Messenger Café — open for fun 24/7. Hot games, cool activities served
> daily. Visit now.
>
> [[alternative HTML version deleted]]
>
>
>
> ------------------------------
>
> Message: 49
> Date: Fri, 10 Aug 2007 14:12:43 -0400
> From: "jim holtman" <jholtman@gmail.com>
> Subject: Re: [R] Help wit matrices
> To: "Lanre Okusanya" <lanre.okusanya@gmail.com>
> Cc: "r-help@stat.math.ethz.ch" <r-help@stat.math.ethz.ch>
> Message-ID:
> <644e1f320708101112g270aeeafub6211ce98cee644d@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Is this what you want:
>
> > x <- matrix(runif(100), 10)
> > round(x, 3)
> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
> [1,] 0.268 0.961 0.262 0.347 0.306 0.762 0.524 0.062 0.028 0.226
> [2,] 0.219 0.100 0.165 0.131 0.578 0.933 0.317 0.109 0.527 0.131
> [3,] 0.517 0.763 0.322 0.374 0.910 0.471 0.278 0.382 0.880 0.982
> [4,] 0.269 0.948 0.510 0.631 0.143 0.604 0.788 0.169 0.373 0.327
> [5,] 0.181 0.819 0.924 0.390 0.415 0.485 0.702 0.299 0.048 0.507
> [6,] 0.519 0.308 0.511 0.690 0.211 0.109 0.165 0.192 0.139 0.681
> [7,] 0.563 0.650 0.258 0.689 0.429 0.248 0.064 0.257 0.321 0.099
> [8,] 0.129 0.953 0.046 0.555 0.133 0.499 0.755 0.181 0.155 0.119
> [9,] 0.256 0.954 0.418 0.430 0.460 0.373 0.620 0.477 0.132 0.050
> [10,] 0.718 0.340 0.854 0.453 0.943 0.935 0.170 0.771 0.221 0.929
> > ifelse(x > .5, 1, 0)
> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
> [1,] 0 1 0 0 0 1 1 0 0 0
> [2,] 0 0 0 0 1 1 0 0 1 0
> [3,] 1 1 0 0 1 0 0 0 1 1
> [4,] 0 1 1 1 0 1 1 0 0 0
> [5,] 0 1 1 0 0 0 1 0 0 1
> [6,] 1 0 1 1 0 0 0 0 0 1
> [7,] 1 1 0 1 0 0 0 0 0 0
> [8,] 0 1 0 1 0 0 1 0 0 0
> [9,] 0 1 0 0 0 0 1 0 0 0
> [10,] 1 0 1 0 1 1 0 1 0 1
>
>
> On 8/10/07, Lanre Okusanya <lanre.okusanya@gmail.com> wrote:
> > Hello all,
> >
> > I am working with a 1000x1000 matrix, and I would like to return a
> > 1000x1000 matrix that tells me which value in the matrix is greater
> > than a theshold value (1 or 0 indicator).
> > i have tried
> > mat2<-as.matrix(as.numeric(mat1>0.25))
> > but that returns a 1:100000 matrix.
> > I have also tried for loops, but they are grossly inefficient.
> >
> > THanks for all your help in advance.
> >
> > Lanre
> >
> > ______________________________________________
> > R-help@stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >
>
>
> --
> Jim Holtman
> Cincinnati, OH
> +1 513 646 9390
>
> What is the problem you are trying to solve?
>
>
>
> ------------------------------
>
> Message: 50
> Date: Fri, 10 Aug 2007 11:12:47 -0700 (PDT)
> From: adiamond <adiamond@csidentity.com>
> Subject: [R] Row name of empty string issue
> To: r-help@stat.math.ethz.ch
> Message-ID: <12096455.post@talk.nabble.com>
> Content-Type: text/plain; charset=us-ascii
>
>
> I have a data.frame with rownames taken from a database. Unfortunately,
> one
> of the rownames (automatically obtained from the DB) is an empty
> string. I
> often do computations on the DB s.t. the answers (rows) are indexed with
> respect to the rownames so a computation on a DB record might necessitate
> the indexing into the data.frame by the emtpy row name. Unfortunately,
> that
> doesn't seem to work. Explicitly:
> I have this statement (in a loop going through sourceNames which are
> rownames of the data.frames CurrentRecordBlankFieldsCountSums and
> BlankFieldsCount):
>
> BlankFieldsCount[sourceNamei,]= BlankFieldsCount[sourceNamei,] +
> CurrentRecordBlankFieldsCountSums[sourceNamei ,];
>
> if sourceNamei is any name other than "" it works fine but
otherwise
> CurrentRecordBlankFieldsCountSums[sourceNamei ,] returns a bunch of NAs
> because apparently it didn't fine a row named "". IMHO, if R
lets you
> name
> a row "", then it should let you index it with the name
"".
>
> Anyway, as further proof of the setup:
> > rownames(CurrentRecordBlankFieldsCountSums)[1]
> [1] ""
> # So the first rowname of CurrentRecordBlankFieldsCountSums is an empty
> string ""
>
> > CurrentRecordBlankFieldsCountSums[1 ,]
> IDCaseNumber Category SSN LastName FirstName
> 0 0 1 0 0
> # So, the first row has some data (not just NAs as would be returned if
> that
> row didn't exist)
>
> But ff I index that same row using the rowname it doesn't find the row:
> > CurrentRecordBlankFieldsCountSums[rownames(
> > CurrentRecordBlankFieldsCountSums)[1] ,]
> IDCaseNumber Category SSN LastName
> NA NA NA NA
> # I get the same result if I do
this:CurrentRecordBlankFieldsCountSums[""
> ,]
>
> As a sanity check:
> > "" == rownames(CurrentRecordBlankFieldsCountSums)[1]
> [1] TRUE
>
> For other rows, (rownames that aren't "", there's no
problem):
> > rownames(CurrentRecordBlankFieldsCountSums)[2]
> [1] "FRED"
> > CurrentRecordBlankFieldsCountSums[rownames(
> > CurrentRecordBlankFieldsCountSums)[2] ,]
> IDCaseNumber Category SSN LastName FirstName
> FRED 0 0 0 0
>
> --
> View this message in context:
>
http://www.nabble.com/Row-name-of-empty-string-issue-tf4250291.html#a12096455
> Sent from the R help mailing list archive at Nabble.com.
>
>
>
> ------------------------------
>
> Message: 51
> Date: Fri, 10 Aug 2007 14:19:57 -0400
> From: "Lanre Okusanya" <lanre.okusanya@gmail.com>
> Subject: Re: [R] Help wit matrices
> To: "jim holtman" <jholtman@gmail.com>
> Cc: "r-help@stat.math.ethz.ch" <r-help@stat.math.ethz.ch>
> Message-ID:
> <6e25bb420708101119u55f04e5aq977a718c873e1557@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> that was ridiculously simple. duh.
>
> THanks
>
> Lanre
>
> On 8/10/07, jim holtman <jholtman@gmail.com> wrote:
> > Is this what you want:
> >
> > > x <- matrix(runif(100), 10)
> > > round(x, 3)
> > [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
> > [1,] 0.268 0.961 0.262 0.347 0.306 0.762 0.524 0.062 0.028 0.226
> > [2,] 0.219 0.100 0.165 0.131 0.578 0.933 0.317 0.109 0.527 0.131
> > [3,] 0.517 0.763 0.322 0.374 0.910 0.471 0.278 0.382 0.880 0.982
> > [4,] 0.269 0.948 0.510 0.631 0.143 0.604 0.788 0.169 0.373 0.327
> > [5,] 0.181 0.819 0.924 0.390 0.415 0.485 0.702 0.299 0.048 ...
>
> [Message clipped]
[[alternative HTML version deleted]]