[R] Generating a bivariate joint t distribution in R

2013-04-03 Thread jpm miao
Hi, I conduct a panel data estimation and obtain estimators for two of the coefficients beta1 and beta2. R tells me the mean and covariance of the distribution of (beta1, beta2). Now I would like to find the distribution of the quotient beta1/beta2, and one way to do it is to simulate via the

Re: [R] Generating a bivariate joint t distribution in R

2013-04-03 Thread Jorge I Velez
Dear Miao, Check require(MASS) ?mvrnorm for some ideas. HTH, Jorge.- On Wed, Apr 3, 2013 at 4:57 PM, jpm miao wrote: Hi, I conduct a panel data estimation and obtain estimators for two of the coefficients beta1 and beta2. R tells me the mean and covariance of the distribution of

[R] Matrixplot (VIM package): can I add a colour scale?

2013-04-03 Thread Ross Marriott
Dear R Help, I would like to know how to add a colour scale to a matrixplot please. Here is the code that I've used to construct the matrix plot: library(VIM) SpatialPlot - function(YearxBlock,plot.title){ # Years are columns, Blocks are rows in this matrix YearxBlock - as.matrix(YearxBlock) #

Re: [R] creating a loop if to create a column of 0 and 1.

2013-04-03 Thread PIKAL Petr
Hi Check your keyboard, your enter key must be broken. If I decrypt your message and assume that Nfiltered and Presyabs has the same length, then Presyabs[Nfiltered==0] - 0 In case you have some missing values use Presyabs[which(Nfiltered==0)] - 0 Without knowledge of structure of CPOD

[R] Question: how to convert raw to numeric

2013-04-03 Thread Mike Chen
I know that there is a function to convert binary data to string named rawToChar.but I wander is there any similar function for Integer and float.I need to read some binary file in integer and float data. I can do this job in this way: (as below) first convert 4 byte raw to bits then pack bits

[R] linear model coefficients by year and industry, fitted values, residuals, panel data

2013-04-03 Thread Cecilia Carmo
Hi R-helpers, My real data is a panel (unbalanced and with gaps in years) of thousands of firms, by year and industry, and with financial information (variables X, Y, Z, for example), the number of firms by year and industry is not always equal, the number of years by industry is not always

Re: [R] Generating a bivariate joint t distribution in R

2013-04-03 Thread Marc Girondot
Le 03/04/13 07:57, jpm miao a écrit : Hi, I conduct a panel data estimation and obtain estimators for two of the coefficients beta1 and beta2. R tells me the mean and covariance of the distribution of (beta1, beta2). Now I would like to find the distribution of the quotient beta1/beta2, and

[R] qpplot.das

2013-04-03 Thread Shane Carey
Hi, I am using qpplot.das to produce a probability plot of my data. Some of the data are negative values and once logged, NaN values are produced. Does anybody know, what happens these NaN values, are they just removed from the dataset before the other points are plotted? Thanks -- Shane

Re: [R] speedometer charts in R

2013-04-03 Thread Barry Rowlingson
On Tue, Apr 2, 2013 at 4:00 PM, R. Michael Weylandt michael.weyla...@gmail.com wrote: Look at the R GoogleVis package. Or read what Hadley W had to say on a similar question first: The question would why would you want to? You are trying to understand your data, not driving a race car or

Re: [R] speedometer charts in R

2013-04-03 Thread andrija djurovic
Hi. Thanks for help. In meanwhile some of contributors already send me the same link with examples. I agree with you and I am not trying to drive a race car just to do what was asked from me :) Andrija On Wed, Apr 3, 2013 at 11:24 AM, Barry Rowlingson b.rowling...@lancaster.ac.uk wrote: On

[R] R 3.0.0 is released

2013-04-03 Thread Peter Dalgaard
The build system rolled up R-3.0.0.tar.gz (codename Masked Marvel) this morning. The list below details the changes in this release. You can get the source code from http://cran.r-project.org/src/base/R-3/R-3.0.0.tar.gz or wait for it to be mirrored at a CRAN site nearer to you. Binaries

[R] Better way of writing R code

2013-04-03 Thread Katherine Gobin
Dear R forum, (Pl note this is not a finance problem) I have two data.frames as currency_df = data.frame(current_date = c(3/4/2013, 3/4/2013, 3/4/2013, 3/4/2013), issue_date = c(27/11/2012, 9/12/2012, 14/01/2013, 28/02/2013), maturity_date = c(27/04/2013, 3/5/2013, 14/6/2013, 28/06/2013),

[R] Packages on R 3.0.0

2013-04-03 Thread Tal Galili
Hello all, I see that R 3.0.0 is announced (hurray!), and have a question regarding this line in the NEWS file: Packages need to be (re-)installed under this version (3.0.0) of R. Assuming I copy my packages to the new library folder and run update.packages will it be enough? Or is there

Re: [R] Iterative regression through a series

2013-04-03 Thread Rui Barradas
Hello, I've made a samll change to the code, and with your example data it's now working without errors. N - nrow(example) estim - numeric(N) # It's better to allocate the results error - numeric(N) # vectors in advance for (i in seq_len(N)) { regr - lm(example$Price[1:i] ~

Re: [R] Packages on R 3.0.0

2013-04-03 Thread Prof Brian Ripley
On 03/04/2013 11:43, Tal Galili wrote: Hello all, I see that R 3.0.0 is announced (hurray!), and have a question regarding this line in the NEWS file: Packages need to be (re-)installed under this version (3.0.0) of R. Assuming I copy my packages to the new library folder and run

Re: [R] Matrixplot (VIM package): can I add a colour scale?

2013-04-03 Thread Jim Lemon
On 04/03/2013 04:43 PM, Ross Marriott wrote: Dear R Help, I would like to know how to add a colour scale to a matrixplot please. Here is the code that I've used to construct the matrix plot: library(VIM) SpatialPlot- function(YearxBlock,plot.title){ # Years are columns, Blocks are rows in

Re: [R] linear model coefficients by year and industry, fitted values, residuals, panel data

2013-04-03 Thread Adams, Jean
Cecilia, Thanks for providing a reproducible example. Excellent. You could use the ddply() function in the plyr package to fit the model for each industry and year, keep the coefficients, and then estimate the fitted and residual values. Jean library(plyr) coef - ddply(final3, .(industry,

[R] Canadian politcal party colours in ggplot2

2013-04-03 Thread John Kane
A stupid question but does anyone know how to express the actual colours used by the main Canadian political parties? I want to do a couple of ggplot2 plots and have lines or rectangles that accurately reflect the party colours. I can probably play around with RColorBrewer or something to

Re: [R] Better way of writing R code

2013-04-03 Thread Adams, Jean
Katherine, You don't need to convert rate_df into tabular form. You just need to categorize each row in currency_df into a tenor. Then you can merge the two data frames (by currency and tenor). For example ... # convert dates to R dates, to calculate the number of days to maturity # I am

Re: [R] Canadian politcal party colours in ggplot2

2013-04-03 Thread Ista Zahn
Hi John, How about this: library(XML) party.info - readHTMLTable(http://en.wikipedia.org/wiki/Wikipedia:WikiProject_Political_parties_and_politicians_in_Canada/list_of_parties;) fed.party.info - party.info[[3]] fed.party.colors - fed.party.info[, 2] names(fed.party.colors) - gsub(^.*\\|, ,

Re: [R] lmer, p-values and all that

2013-04-03 Thread Nutter, Benjamin
My apologies for coming late into this conversation, but I'm curious about something in your response You use the following code to peform a likelihood ratio test between an lm object and a mer object fm0 - lm(distance~age,data=Orthodont) fm2 -

Re: [R] Canadian politcal party colours in ggplot2

2013-04-03 Thread Duncan Murdoch
On 03/04/2013 9:08 AM, John Kane wrote: A stupid question but does anyone know how to express the actual colours used by the main Canadian political parties? I want to do a couple of ggplot2 plots and have lines or rectangles that accurately reflect the party colours. I can probably play

[R] arrayInd and which

2013-04-03 Thread Keith S Weintraub
Folks, I have Googled but not found much regarding arrayInd aside from the which help page. Any good examples or docs on what arrayInd does that is better or different from which()? In addition take the following 20x10 matrix: td-structure(c(1, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 4, 6, 6, 6, 6,

Re: [R] Generating a bivariate joint t distribution in R

2013-04-03 Thread David Winsemius
On Apr 2, 2013, at 11:07 PM, Jorge I Velez wrote: Dear Miao, Check require(MASS) ?mvrnorm Also package mvtnorm has both Normal and t versions of its p,q, r funtions for some ideas. HTH, Jorge.- On Wed, Apr 3, 2013 at 4:57 PM, jpm miao wrote: Hi, I conduct a panel

[R] Superscript

2013-04-03 Thread Shane Carey
Hi, How do I write a superscript within gsub? I have the following: gsub(_mgkg,expression(paste(mg kg^{-1})),names[1]) Thanks -- Shane [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] Question: how to convert raw to numeric

2013-04-03 Thread Henrik Bengtsson
See ?readBin - works also with raw objects. Henrik On Apr 3, 2013 1:18 AM, Mike Chen chenminyi1...@gmail.com wrote: I know that there is a function to convert binary data to string named rawToChar.but I wander is there any similar function for Integer and float.I need to read some binary file

Re: [R] Superscript

2013-04-03 Thread Duncan Murdoch
On 03/04/2013 11:01 AM, Shane Carey wrote: Hi, How do I write a superscript within gsub? I have the following: gsub(_mgkg,expression(paste(mg kg^{-1})),names[1]) gsub() doesn't work with expressions, it works with character strings. You're going to need to split your string into parts

Re: [R] Superscript

2013-04-03 Thread Shane Carey
Ok thanks On Wed, Apr 3, 2013 at 4:15 PM, Duncan Murdoch murdoch.dun...@gmail.comwrote: On 03/04/2013 11:01 AM, Shane Carey wrote: Hi, How do I write a superscript within gsub? I have the following: gsub(_mgkg,expression(paste(**mg kg^{-1})),names[1]) gsub() doesn't work with

Re: [R] Superscript

2013-04-03 Thread Jeff Newmiller
gsub searches strings, not expressions. --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#. Live Go...

Re: [R] arrayInd and which

2013-04-03 Thread Adams, Jean
KW, I don't know anything about arrayInd, so I can't help with that question. In order to determine if there is a better way to do your comparison depends largely on what you want to do with the results. The way that you're doing it now seems fine to me, but I wonder what you want to use the

[R] Process substitution and read.table/scan

2013-04-03 Thread Elena Grassi
Hello, I did the same question on stackoverflow (http://stackoverflow.com/questions/15784373/process-substitution) but did not understand completely the issue so I'm reporting it here: I've given a look around about what puzzles me and I only found this:

[R] scanning data in R

2013-04-03 Thread Naser Jamil
Dear R-user, May I seek your suggestion. I have a data file 'stop' to be scanned in R. But I want to ignore one specific number '21' there. Putting differently, I want to get all numbers in the file except 21. Is there any command to achieve it?

[R] (no subject)

2013-04-03 Thread Ana Lucía Cárdenas Martínez
Hello, I want to perform a latent class analysis using poLCA package. My formula is: substances - cbind(subs1, subs2, subs3, subs4, subs5, subs6) ~ gender+age+education+income+occupation+urban+dbehavior+incarceration+treatment+depression+alcriteria I want to include sample weights in the

[R] install packages and time-out

2013-04-03 Thread Menezes, David
I use R / RStudio at work. Recently, I tried to download XLConnect package using install.packages(XLConnect) However, I got the following error message: Installing package(s) into 'WORKCOMPUTER SPECIFIC STUFF HERE Documents/R/win-library/2.15' (as 'lib' is unspecified) trying URL

[R] transformation maximizing the Kurtosis

2013-04-03 Thread Fluss
Hello, I have multivariate data - matrix X with n rows and p columns. I want to do a linear transformation V=XA similar to PCA but maximizing the Kurtosis instead of the variance. The purpose is to identify potential outliers. I have seen this paper (section 3.1)

Re: [R] kernlab::kkmeans initial centers

2013-04-03 Thread Ahmed Elgohary
I am not asking about k-means. I am asking about passing initial assignments to the kernel k means algorithm. In kernel k-means, centroids are not defined explicitly. I tried passing initial centroids in the original feature space though. But, it did not work. The provided example just sets the

Re: [R] kernlab::kkmeans initial centers

2013-04-03 Thread Pascal Oettli
Hi, The output of the provided example shows you which kind of matrix you need for cluster centers. In the example, 3 centers per variable (4) are defined. Thus, the initial cluster centers are defined by a 3x4 matrix. HTH, Pascal De : Ahmed Elgohary

[R] Ask help

2013-04-03 Thread DONG Echo
Hello! I am eager to learn if I only have a data about the relationship between otu and sample, could I use the function capscale, and final make a point plot that x-axis is CAP1 and y-axis is CAP2? Besides, what function could I use to make the different rarefaction curve with different

Re: [R] kernlab::kkmeans initial centers

2013-04-03 Thread Ahmed Elgohary
thanks for your reply but, I am still confused what kind of centroids the 3x4 matrix represents. In fact, I passed that 3x4 centers matrix as the initial centers to kkmeans method and I am getting the error Error in crossprod(x[vgr[[i]], vgr[[i]], drop = FALSE], w[vgr[[i]]]) : object 'vgr' not

Re: [R] scanning data in R

2013-04-03 Thread David L Carlson
You can certainly do it after scanning all the numbers in with b - scan(F:\\stop.txt, what=integer()) b - b[b!=21] -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message-

[R] Superscript and for loops

2013-04-03 Thread Shane Carey
Hi, If I have data as follows: DATA_names-c( A mg kg B mg kg C mg kg D mg kg E mg kg F mg kg G mg kg H mg kg How do I convert to: -1 A (mg kg ) -1 B (mg kg ) -1 C (mg kg ) -1 D (mg kg ) -1 E (mg kg ) -1 F (mg

Re: [R] scanning data in R

2013-04-03 Thread Robert Baer
On 4/3/2013 4:33 AM, Naser Jamil wrote: Dear R-user, May I seek your suggestion. I have a data file 'stop' to be scanned in R. But I want to ignore one specific number '21' there. Putting differently, I want to get all numbers in the file except 21. Is there any command to achieve it?

Re: [R] Superscript

2013-04-03 Thread William Dunlap
Are you trying to convert a column name like Na_mgkg to a plot label like Na (mg kg^-1) ? If so you will have to use both string manipulation functions like gsub() and expression manipulating functions like bquote(). E.g., f - function (name) { # add other suffices and their corresponding

Re: [R] Model Selection based on individual t-values with the largest possible number of variables in regression

2013-04-03 Thread Frank Harrell
To say that these strategies represent bad statistical practice is to put it mildly. Frank mister_O wrote Dear R-Community, When writing my master thesis, I faced with difficult issue. Analyzing the capital structure determinants I have one dependent variable (Total debt ratio = TD) and 15

Re: [R] DUD (Does not Use Derivatives) for nonlinear

2013-04-03 Thread Prof J C Nash (U30A)
Date: Tue, 2 Apr 2013 06:59:13 -0500 From: Paul Johnson pauljoh...@gmail.com To: qi A send2...@gmail.com Cc: R-help r-help@r-project.org Subject: Re: [R] DUD (Does not Use Derivatives) for nonlinear regression in R? Message-ID:

Re: [R] scanning data in R

2013-04-03 Thread arun
vec- scan(stop.txt) #Read 635 items vec1-vec[vec!=21]  length(vec1) #[1] 584 any(vec1==21) #[1] FALSE A.K. - Original Message - From: Naser Jamil jamilnase...@gmail.com To: R help r-help@r-project.org Cc: Sent: Wednesday, April 3, 2013 5:33 AM Subject: [R] scanning data in R Dear

Re: [R] Superscript and for loops

2013-04-03 Thread David Winsemius
On Apr 3, 2013, at 9:06 AM, Shane Carey wrote: Hi, If I have data as follows: DATA_names-c( A mg kg B mg kg C mg kg D mg kg E mg kg F mg kg G mg kg H mg kg How do I convert to: -1 A (mg kg ) -1 B (mg kg ) -1 C (mg kg )

Re: [R] arrayInd and which

2013-04-03 Thread David Winsemius
On Apr 3, 2013, at 7:53 AM, Keith S Weintraub wrote: Folks, I have Googled but not found much regarding arrayInd aside from the which help page. Any good examples or docs on what arrayInd does that is better or different from which()? In addition take the following 20x10 matrix:

Re: [R] linear model coefficients by year and industry, fitted values, residuals, panel data

2013-04-03 Thread Peter Ehlers
A few minor improvements to Jean's post suggested inline below. On 2013-04-03 05:41, Adams, Jean wrote: Cecilia, Thanks for providing a reproducible example. Excellent. You could use the ddply() function in the plyr package to fit the model for each industry and year, keep the coefficients,

Re: [R] arrayInd and which

2013-04-03 Thread David Winsemius
On Apr 3, 2013, at 10:59 AM, David Winsemius wrote: On Apr 3, 2013, at 7:53 AM, Keith S Weintraub wrote: Folks, I have Googled but not found much regarding arrayInd aside from the which help page. Any good examples or docs on what arrayInd does that is better or different from

Re: [R] scanning data in R

2013-04-03 Thread David Winsemius
On Apr 3, 2013, at 2:33 AM, Naser Jamil wrote: Dear R-user, May I seek your suggestion. I have a data file 'stop' to be scanned in R. But I want to ignore one specific number '21' there. Putting differently, I want to get all numbers in the file except 21. Is there any command to achieve

Re: [R] Superscript and for loops

2013-04-03 Thread Shane Carey
Yup, I want these as labels on plots, but I need it as: D (mg kg^-1) rather than D (mg kg)^-1. Sorry for not being more clear and thanks for your help. Cheers On Wed, Apr 3, 2013 at 6:44 PM, David Winsemius dwinsem...@comcast.netwrote: On Apr 3, 2013, at 9:06 AM, Shane Carey wrote: Hi,

Re: [R] Superscript

2013-04-03 Thread Shane Carey
Hi William, This is exactly what Im trying to do. Your a star, Thanks On Wed, Apr 3, 2013 at 5:33 PM, William Dunlap wdun...@tibco.com wrote: Are you trying to convert a column name like Na_mgkg to a plot label like Na (mg kg^-1) ? If so you will have to use both string manipulation

Re: [R] linear model coefficients by year and industry, fitted values, residuals, panel data

2013-04-03 Thread Adams, Jean
Peter. For suggestion 1, what advantages are there to using coef() rather than $coef? For suggestion 2, thanks! I'm new to the plyr package and wasn't aware of the mutate() function. Jean On Wed, Apr 3, 2013 at 1:01 PM, Peter Ehlers ehl...@ucalgary.ca wrote: A few minor improvements to

[R] Changing y-axis in ggplot to show proportions instead of density

2013-04-03 Thread Camilo Mora
Hi Everyone, I have a frequency data, which I am displaying with an area-curve-like plot in ggplot2 using: ggplot(dfs, aes(x=values)) + geom_density(aes(group=ind)) The Y-axis that is returned is density, which is not really intuitive for my purposes and I would like to change it for

Re: [R] {Spam?} Re: linear model coefficients by year and industry, fitted values, residuals, panel data

2013-04-03 Thread Peter Ehlers
On 2013-04-03 11:54, Adams, Jean wrote: Peter. For suggestion 1, what advantages are there to using coef() rather than $coef? Not much difference for lm models, but note that it does use the partial matching 'feature' of the '$' extractor, since the component name is actually 'coefficients'.

[R] Make cdf package error Human Exon array

2013-04-03 Thread Maria Arnedo Munoz
Hello everybody! I am not sure if this is the way for asking because I am new in this kind of help-website so, please if I am wrong tell me. I am trying to make a cdf package for the Human Exon Array chip from Affymetrix (HuEx-1_0-st-v2). I have downloaded the file HuEx-10-st-v2.cdf from

Re: [R] scanning data in R

2013-04-03 Thread Naser Jamil
Many thanks, Prof. David. It's exactly what I wanted! On 3 April 2013 17:26, David L Carlson dcarl...@tamu.edu wrote: You can certainly do it after scanning all the numbers in with b - scan(F:\\stop.txt, what=integer()) b - b[b!=21] -- David L

Re: [R] Make cdf package error Human Exon array

2013-04-03 Thread Martin Morgan
On 04/03/2013 10:15 AM, Maria Arnedo Munoz wrote: Hello everybody! I am not sure if this is the way for asking because I am new in this kind of help-website so, please if I am wrong tell me. Hi Maria -- makecdfenv is a Bioconductor package, so ask on their mailing list

[R] Help with lmRob function

2013-04-03 Thread Mark Chaffin
Hi, I am fairly new to R and have encountered an issue with the lmRob function that I have been unable to resolve. I am trying to run a robust regression using the lmRob function which runs successfully, but the results are rather strange. I'm not sure it's important, but my model has 3

[R] Problem with integrate function

2013-04-03 Thread Swagato Chatterjee
Hello, The following code of mine is giving the error: Error in integrate(fx[[2]], 0.056, 1) : maximum number of subdivisions reached Can anyone help? Thanks and Regards. Swagato -- fv-vector(list) fx-vector(list) v-0 c-0 n-0 NOV-0 i-0 while(n200){

Re: [R] DUD (Does not Use Derivatives) for nonlinear

2013-04-03 Thread Rolf Turner
On 04/04/2013 05:34 AM, Prof J C Nash (U30A) wrote: SNIP Most optimization problems have more than one answer, and the wrong ones often seem to be easier to find. Fortune? cheers, Rolf Turner __ R-help@r-project.org mailing list

Re: [R] linear model coefficients by year and industry, fitted values, residuals, panel data

2013-04-03 Thread Rolf Turner
On 04/04/2013 07:54 AM, Adams, Jean wrote: Peter. For suggestion 1, what advantages are there to using coef() rather than $coef? Just thought I'd chip in: It is considered, uh, politically correct to use extractor functions rather than digging out components of objects in a direct manner.

[R] Can package plyr also calculate the mode?

2013-04-03 Thread ramoss
I am trying to replicate the SAS proc univariate in R. I got most of the stats I needed for a by grouping in a data frame using: all1 - ddply(all,ACT_NAME, summarise, mean=mean(COUNTS), sd=sd(COUNTS), q25=quantile(COUNTS,.25),median=quantile(COUNTS,.50), q75=quantile(COUNTS,.75),

[R] how to re-shape a matrix

2013-04-03 Thread Hui Du
Hi All, I have a matrix like m - matrix( letters[1:10], ncol=5) How to conver it to 10 * 3 matrix, which the first col is row index of m, second col is colum index of m and third column is the value of matrix, say 11 1a 21 2 c 1 3 e etc... Thanks.

Re: [R] Can package plyr also calculate the mode?

2013-04-03 Thread Sarah Goslee
Sure, you can add the mode in, following the format by the other summary statistics. ?mode Sarah On Wed, Apr 3, 2013 at 5:25 PM, ramoss ramine.mossad...@finra.org wrote: I am trying to replicate the SAS proc univariate in R. I got most of the stats I needed for a by grouping in a data frame

Re: [R] how to re-shape a matrix

2013-04-03 Thread Sarah Goslee
Thanks for the reproducible example. Because this mixes numeric and character data, it's better done as a data frame than a matrix. data.frame(rowind=as.vector(row(m)), colind=as.vector(col(m)), value = as.vector(m)) rowind colind value 1 1 1 a 2 2 1 b 3

Re: [R] Can package plyr also calculate the mode?

2013-04-03 Thread Sarah Goslee
If you type ?mode at an R prompt you will be able to read the help for the mode() function. On Wed, Apr 3, 2013 at 5:34 PM, Mossadegh, Ramine N. ramine.mossad...@finra.org wrote: I tried mode=?mode(COUNTS) but that doesn't work. -Original Message- From: Sarah Goslee

[R] looking for help with clustering analysis

2013-04-03 Thread capricy gao
My data have good correlations with spearman method and bad correlations with pearson method. If I want to do cluster analysis to reflect the sprearman correlation, what method should I use to calculate the distance matrix? Thanks. Xin  

Re: [R] looking for help with clustering analysis

2013-04-03 Thread David Winsemius
On Apr 3, 2013, at 2:38 PM, capricy gao wrote: My data have good correlations with spearman method and bad correlations with pearson method. If I want to do cluster analysis to reflect the sprearman correlation, what method should I use to calculate the distance matrix? Thanks.

Re: [R] Can package plyr also calculate the mode?

2013-04-03 Thread Sarah Goslee
Of course it can. Use the mode() in the same way you used the mean() function. You didn't provide a reproducible example, so I can't provided tested code, but I would think that you can add mode=mode(COUNTS) to the ddply() arguments. all1 - ddply(all,ACT_NAME, summarise, mean=mean(COUNTS),

Re: [R] Problem with integrate function

2013-04-03 Thread S Ellison
Error in integrate(fx[[2]], 0.056, 1) : maximum number of subdivisions reached Can anyone help? At the risk of longer integration time, look at the 'subdivisions' argument in ?integrate and consider increasing it? S Ellison ***

[R] prop.test vs hand calculated confidence interval

2013-04-03 Thread David Arnold
Hi, This code: n=40 x=17 phat=x/n SE=sqrt(phat*(1-phat)/n) zstar=qnorm(0.995) E=zstar*SE phat+c(-E,E) Gives this result: [1] 0.2236668 0.6263332 The TI Graphing calculator gives the same result. Whereas this test: prop.test(x,n,conf.level=0.99,correct=FALSE) Give this result: 0.2489036

Re: [R] prop.test vs hand calculated confidence interval

2013-04-03 Thread Sarah Goslee
One of the joys of R is that it's open source: you can read the code for prop.test yourself and see what's happening. In this case, simply typing prop.test at the command line will provide it, although without comments. Sarah On Wed, Apr 3, 2013 at 6:10 PM, David Arnold

Re: [R] Ask help

2013-04-03 Thread Jim Lemon
On 04/04/2013 01:31 AM, DONG Echo wrote: Hello! I am eager to learn if I only have a data about the relationship between otu and sample, could I use the function capscale, and final make a point plot that x-axis is CAP1 and y-axis is CAP2? Besides, what function could I use to make the

[R] a question about clustering

2013-04-03 Thread JiangMei
Hi all. Sorry to bother you. I have a table like the following A B C D E F G1 0 1 1 0 1 1 G2 0 1 1 0 1 1 G3 0 0 0 0 0 1 H1 1 1 1 1 1 1 H2 1 0 1 1 0 1 H3 1 0 1 1 0 1 I already know G1, G2 and G3 belong to the same group and H1, H2 and H3 belong to the other group. I want

Re: [R] prop.test vs hand calculated confidence interval

2013-04-03 Thread Albyn Jones
It might help to look at the documentation. Typing ?prop.test on the command line. That would reveal various items of interest, including a section labeled Details. A close reading of that section turns up the explanation: The confidence interval is computed by inverting the score test.

Re: [R] Can package plyr also calculate the mode?

2013-04-03 Thread Peter Ehlers
On 2013-04-03 14:59, Sarah Goslee wrote: Of course it can. Use the mode() in the same way you used the mean() function. You didn't provide a reproducible example, so I can't provided tested code, but I would think that you can add mode=mode(COUNTS) to the ddply() arguments. ?mode will direct

[R] Creating data frame from individual files

2013-04-03 Thread Adrian Johnson
Dear Group: I have 72 files (.txt). Each file has 2 columns and column 1 is always identical for all 70 files. Each file has 90,799 rows and is standard across all files. I want to create a matrix 40(rows) x 70 columns. I tried : temp = list.files(pattern=*.txt) named.list - lapply(temp,

Re: [R] Can package plyr also calculate the mode?

2013-04-03 Thread Jim Lemon
On 04/04/2013 09:56 AM, Peter Ehlers wrote: On 2013-04-03 14:59, Sarah Goslee wrote: Of course it can. Use the mode() in the same way you used the mean() function. You didn't provide a reproducible example, so I can't provided tested code, but I would think that you can add mode=mode(COUNTS)

[R] ploting several functions on the same plot

2013-04-03 Thread Julio Sergio
I want to superimpose two functions plots in the same page. The functions L0 and L1, defined below f0 - function(mu, xm, ds, n) { 1 - pnorm((xm-mu)/(ds/sqrt(n))) } f1 - function(mu,n) f0(mu, 386.8, 48, n) L0 - function(mu) f1(mu, 36) plot(L0,ylim=c(0,1),xlim=c(360,420)) L1 -

Re: [R] ploting several functions on the same plot

2013-04-03 Thread Duncan Murdoch
On 13-04-03 7:35 PM, Julio Sergio wrote: I want to superimpose two functions plots in the same page. The functions L0 and L1, defined below f0 - function(mu, xm, ds, n) { 1 - pnorm((xm-mu)/(ds/sqrt(n))) } f1 - function(mu,n) f0(mu, 386.8, 48, n) L0 - function(mu) f1(mu, 36)

Re: [R] Can package plyr also calculate the mode?

2013-04-03 Thread Sarah Goslee
My apologies: that's what happens when I don't start a clean session with no packages loaded. (Also yet another argument for reproducible examples: I always start a clean session to actualy create objects and run other people's code.) This might be of use (especially compared to my original

Re: [R] Creating data frame from individual files

2013-04-03 Thread arun
Hi, suppose, you have 3 files with 2 columns: named.list- list(structure(list(col1 = 1:6, col2 = c(0.5, 0.2, 0.3, 0.3, 0.1, 0.2)), .Names = c(col1, col2), class = data.frame, row.names = c(NA, -6L)), structure(list(col1 = 1:6, col2 = c(0.9, 0.7, 0.5, 0.2, 0.5, 0.2)), .Names = c(col1, col2),

[R] Select single probe-set with median expression from multiple probe-sets corresponding to same gene -AFFY

2013-04-03 Thread Atul Kakrana
Hello All, I need your help. I am analysing affymetrix data and have to select the probe-set that has median expression among all the probe-sets for same gene. This way I want to remove the redundancy by keeping the analysis to single gene entry level. I am fully aware that it is not a nice thing

[R] Problem quitting

2013-04-03 Thread Julian Wells
Can someone explain why all of a sudden I can't quit? q(n) returns Error in gzfile(file, wb) : cannot open the connection In addition: Warning message: In gzfile(file, wb) : cannot open compressed file '.RDataTmp', probable reason 'Permission denied' I'm running R 2.15.3 GUI 1.53 Leopard

[R] Deviance in Zero inflated models

2013-04-03 Thread Lia McKinnon
Dear list, I am running some zero inflated models and would like to know what the deviance of the models. Unlike running a normal GLM where the deviance is displayed in the summary all that is displayed in a summary of the zero inflated model is the log likelihood. I hope this isn't a read the

Re: [R] ploting several functions on the same plot

2013-04-03 Thread Julio Sergio
Duncan Murdoch murdoch.duncan at gmail.com writes: curve(L1, add=TRUE) should handle it. Thanks Duncan, Your solution worked great! However, I'm puzzled for a problem in the same line: When I passed a function producer to plot, again it works well; however it doesn't work in the same way

Re: [R] Deviance in Zero inflated models

2013-04-03 Thread Ben Bolker
Lia McKinnon l.mckinnon101 at gmail.com writes: I am running some zero inflated models and would like to know what the deviance of the models. Unlike running a normal GLM where the deviance is displayed in the summary all that is displayed in a summary of the zero inflated model is the log

Re: [R] Select single probe-set with median expression from multiple probe-sets corresponding to same gene -AFFY

2013-04-03 Thread Martin Morgan
On 04/03/2013 03:17 PM, Atul Kakrana wrote: Hello All, I need your help. I am analysing affymetrix data and have to select the probe-set that has median expression among all the probe-sets for same gene. This way I want to remove the redundancy by keeping the analysis to single gene entry

Re: [R] Select single probe-set with median expression from multiple probe-sets corresponding to same gene -AFFY

2013-04-03 Thread Martin Morgan
On 04/03/2013 08:34 PM, Martin Morgan wrote: On 04/03/2013 03:17 PM, Atul Kakrana wrote: Hello All, I need your help. I am analysing affymetrix data and have to select the probe-set that has median expression among all the probe-sets for same gene. This way I want to remove the redundancy by

[R] categorized complete list of R commands?

2013-04-03 Thread ivo welch
every time I read the R release notes for the next release, I see many functions that I had forgotten about and many functions that I never knew existed to begin with. (who knew there were bibtex facilities in R? obviously, everyone except me.) I wonder whether there is a complete list of all R

[R] node stack overflow when extracting labels from a dendrogram

2013-04-03 Thread Oleksandr Moskalenko
It looks like R 3.0.0 has the same limitation as the 2.x series. When extracting labels from about 3 node dendrogram (x=labels(h)) R throws an error: Error in match.fun(FUN) : node stack overflow Is there a way around it? Thanks, Alex __

[R] MAS (non-parametric semi-parametric) methods for survey longitudinal data

2013-04-03 Thread Anupam Tyagi
Is there a package that provides equivalents of MASS package, especially non-parametric and semi-parametric methods for complex survey and longitudinal data? Is there a book that someone recommend that covers these topics with R (or Stata) examples? My web-searches have not resulted in much except

Re: [R] making scatter plot points fill semi-transparent

2013-04-03 Thread Kika Tarsi
Hey hey, I know that this thread is old, but no one seemed to provide the answer. Yes, there is absolutely a way to bring in transparency while still using normal colornames. Just use this code when specifying your color: col=adjustcolor(colorname, alpha=0.5) Alpha values can range from 0 to

[R] help with kriging interpolation

2013-04-03 Thread Alfred Oswago
All, I am new to using R and know some basics. I wish to use kriging in R to do the following: given data Y =f(X1,X2,X3,.,Xn) --1000+ irregular measured data set. I would like to be able to get a single value y given sinle input set (x1,x2,x3,...xn) A google search on this takes me