Re: [R] Reshape from long to wide

2012-03-19 Thread Gabor Grothendieck
On Mon, Mar 19, 2012 at 7:01 PM, aly wrote: > > Hi, > > I'm a total beginner in R and this question is probably very simple but I've > spent hours reading about it and can't find the answer. I'm trying to > reshape a data table from long to wide format. I've tried reshape() and > cast() but I get

Re: [R] Output formatting in Latex and R

2012-03-19 Thread Jorge I Velez
Hi Manish, Try > cat(sqrt(2),"\n") 1.414214 See ?cat for more information. HTH, Jorge.- On Mon, Mar 19, 2012 at 10:42 PM, Manish Gupta <> wrote: > How to avoid [1] in output? > > print(sqrt(2),row.names=NULL) > *[1] *1.414214 > > How to avoid it? > > print(sqrt(2),row.names=NULL) > 1.414214

Re: [R] Reshape from long to wide

2012-03-19 Thread Jorge I Velez
Hi aly, Try # your data x <- structure(list(family = c(14L, 14L, 15L, 15L, 17L, 17L, 18L, 18L, 20L, 20L, 24L, 24L, 25L, 25L, 27L, 27L, 28L, 28L, 29L, 29L ), length = c(18L, 7L, 7L, 21L, 50L, 21L, 36L, 21L, 36L, 42L, 56L, 42L, 43L, 56L, 15L, 42L, 7L, 42L, 56L, 49L)), .Names = c("family", "length")

[R] R (Bold font) and Latex

2012-03-19 Thread Manish Gupta
Hi, I am using R and latex for generating report. I need R result to be in bold face. For instance. x<-c(1,0,2,4) I need to print its output in bold face. x *1 2 3 4* I attempted to use textbf{} but can not write R output inside it. How can i implement it. Thanks in advance. Regards -- Vi

Re: [R] Output formatting in Latex and R

2012-03-19 Thread Manish Gupta
How to avoid [1] in output? print(sqrt(2),row.names=NULL) *[1] *1.414214 How to avoid it? print(sqrt(2),row.names=NULL) 1.414214 Regards -- View this message in context: http://r.789695.n4.nabble.com/Output-formatting-in-Latex-and-R-tp4483631p4487480.html Sent from the R help mailing list a

[R] Reshape from long to wide

2012-03-19 Thread aly
Hi, I'm a total beginner in R and this question is probably very simple but I've spent hours reading about it and can't find the answer. I'm trying to reshape a data table from long to wide format. I've tried reshape() and cast() but I get error messages every time and I can't figure why. In my da

Re: [R] Lag based on Date objects with non-consecutive values

2012-03-19 Thread Gabor Grothendieck
On Mon, Mar 19, 2012 at 8:03 PM, Sam Albers wrote: > Hello R-ers, > > I just wanted to update this post. I've made some progress on this but > am still not quite where I need to be. I feel like I am close so I > just wanted to share my work so far. > > Try this: Lines <- "Date Dis1 1967-06-0

[R] Loading Dataset into R continual issue

2012-03-19 Thread bobo
Hi, this is related to academic research I am trying to conduct. Please pardon my lack of socialization for this forum. For my project, I had to combine two different datasets, Democracy dataset from Pippa Norris and World Bank Patents dataset. My issue arrises from just loading the file into R

Re: [R] ggplot2: goem_smooth and suppress messages

2012-03-19 Thread tibaker
Thank you for your help! -- View this message in context: http://r.789695.n4.nabble.com/ggplot2-goem-smooth-and-suppress-messages-tp4476700p4486427.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https

[R] Adding columns to csvs in a loop

2012-03-19 Thread Edgar Alminar
Hello, I am trying to add columns to a folder of csvs (the folder is called "20120314"). I have csvs of different numbers of columns, but at the end of this loop, I'd like to add three columns to each csv: "QID", "COMMENTS", "DATE CREATED". I've tried some things with cbind, I looked at using aw

[R] simple matching with R

2012-03-19 Thread Lisa Krchov
Hello, I would like to use the simple matching coefficient in R to compare genotypic data from two years (there are some inconsistencies in the genotype notations in the 2 years and I want to find out the error). Is there a R code I could use? How does my matrix needs to look like? I have 50 geno

Re: [R] glm: getting the confidence interval for an Odds Ratio, when using predict()

2012-03-19 Thread Dominic Comtois
I apologize for the errors in the previous code. Here is a reworked example. It works, but I suspect problems in the se calculation. I changed, from the 1st prediction to the 2nd only one covariate, so that the OR's CI should be equal to the exponentiated variable's coefficient and ci. And we get s

Re: [R] paste (CTRL + v) not working rgui

2012-03-19 Thread Tyler Rinker
I attempted the advice of Ajay but found that the names ◦Network DDE DSDM, ◦Network DDE, ◦Clipbook were not found in that location. Here's a bit more information about the problem I've discovered. I have a manual I've created of useful R tricks I've elarned that I created as a word doc

Re: [R] Lag based on Date objects with non-consecutive values

2012-03-19 Thread Sam Albers
Hello R-ers, I just wanted to update this post. I've made some progress on this but am still not quite where I need to be. I feel like I am close so I just wanted to share my work so far. Thanks in advance! Sam On Mon, Mar 19, 2012 at 1:10 PM, Sam Albers wrote: > Hello all, > > I need to figur

[R] SE from nleqslv

2012-03-19 Thread FU-WEN LIANG
Dear R-users, I use the "nleqslv" function to get parameter estimates by solving a system of non-linear equations. But I also need standard error for each of estimates. I checked the nleqslv manual but it didn't mention about SE. Is there any way to get the SE for each estimate? Thank you very mu

Re: [R] by output into data frame

2012-03-19 Thread Peter Meilstrup
Thanks for providing a reproducible example. Using the plyr package you can write your whole computation more compactly: library(plyr) library(caTools) #for trapz auc <- ddply(lab.samples, .(challenge, subid), function(df) { df$time <- c(0, seq(60,by=10, len=nrow(df)-1)) summari

Re: [R] by output into data frame

2012-03-19 Thread Peter Ehlers
On 2012-03-19 15:00, Jorge I Velez wrote: Hi David, Thank you for the reproducible example! Try do.call(rbind, auc_stress) cortisol amylase 2 919.05 6834.80 3 728.25 24422.05 4 2106.00 25908.35 6 636.40 12209.75 7 1925.95 4749.25 do.call(rbind, auc_control) cortisol amyl

Re: [R] glm: getting the confidence interval for an Odds Ratio, when using predict()

2012-03-19 Thread peter dalgaard
On Mar 19, 2012, at 22:32 , Dominic Comtois wrote: > Thanks for your answer, much appreciated. > > This ain't trivial indeed. I worked my way through it, until I got a "non > conformable arguments" error when trying to calculate the new standard error. > Since I'm not following 100% what's hap

Re: [R] by output into data frame

2012-03-19 Thread Jorge I Velez
Hi David, Thank you for the reproducible example! Try > do.call(rbind, auc_stress) cortisol amylase 2 919.05 6834.80 3 728.25 24422.05 4 2106.00 25908.35 6 636.40 12209.75 7 1925.95 4749.25 > do.call(rbind, auc_control) cortisol amylase 2 604.90 2458.00 4 587.65 29954.55 6

[R] by output into data frame

2012-03-19 Thread David Perlman
I could do this in various hacky ways, but what's the right way? I have a nice application of the by function, which does what I want. The output looks like this: > auc_stress lab.samples.stress$subid: 2 cortisol amylase 1 919.05 6834.8 -

Re: [R] fitted values with locfit

2012-03-19 Thread Peter Ehlers
On 2012-03-19 02:12, Soberon Velez, Alexandra Pilar wrote: Dear memberships, I'm trying to estimate the following multivariate local regression model using the "locfit" package: BMI=m1(RCC)+m2(WCC) where (m1) and (m2) are unknown smooth functions. My problem is that once I get the regress

Re: [R] glm: getting the confidence interval for an Odds Ratio, when using predict()

2012-03-19 Thread Dominic Comtois
Thanks for your answer, much appreciated. This ain't trivial indeed. I worked my way through it, until I got a "non conformable arguments" error when trying to calculate the new standard error. Since I'm not following 100% what's happening, it's hard for me to figure out what I should do next. He

Re: [R] Coalesce function in BBmisc, emoa, and microbenchmark packages

2012-03-19 Thread Brian Diggs
On 3/17/2012 6:24 AM, Paul Miller wrote: Hello All, Need to coalesce some columns using R. Looked online to see how this is done. One approach appears to be to use ifelse. Also uncovered a coalesce function in the BBmisc, emoa, and microbenchmark packages. Trouble is I can't seem to get it to w

Re: [R] Filling matrices

2012-03-19 Thread Bert Gunter
Please folks! Why issue protestations of "clumsiness" when all you have to do is make some effort to learn R? See section 5.3 of an Intro to R -- which ships with every copy of R -- on matrix indexing. ?"[" also documents the behavior, albeit more tersely. ("... a third form of indexig ...")

Re: [R] Filling matrices

2012-03-19 Thread Berend Hasselman
On 19-03-2012, at 22:07, David Stevens wrote: > I'm a bit clumsy about many things in R. Here's my problem. I'm trying to > build a square sparse matrix and populate it without looping (bad practice, > right). I have vectors of matched row/column pairs for which the matrix > entries have commo

Re: [R] Filling matrices

2012-03-19 Thread Sarah Goslee
I suspect I'm misinterpreting what you are trying to do, because it seems unlikely that the solution is as simple as: A <- matrix(0, 20, 20) iRows <- c(2,3,4,6,7,8,10,11,12,14,15,16,18,19) iCols <- c(1,2,3,5,6,7,9,10,11,13,14,15,17,18) A[iRows, iCols] <- 1 # or a vector of the same length in the s

Re: [R] Filling matrices

2012-03-19 Thread Peter Meilstrup
http://cran.r-project.org/doc/manuals/R-lang.html#Indexing-matrices-and-arrays matrix[cbind(iRows, iCols)] <- values Peter On Mon, Mar 19, 2012 at 2:07 PM, David Stevens wrote: > I'm a bit clumsy about many things in R. Here's my problem. I'm trying to > build a square sparse matrix and populat

Re: [R] Filling matrices

2012-03-19 Thread Peter Langfelder
On Mon, Mar 19, 2012 at 2:07 PM, David Stevens wrote: > I'm a bit clumsy about many things in R. Here's my problem. I'm trying to > build a square sparse matrix and populate it without looping (bad practice, > right). I have vectors of matched row/column pairs for which the matrix > entries have c

[R] Filling matrices

2012-03-19 Thread David Stevens
I'm a bit clumsy about many things in R. Here's my problem. I'm trying to build a square sparse matrix and populate it without looping (bad practice, right). I have vectors of matched row/column pairs for which the matrix entries have common characteristics and am look for a way to fill the ent

Re: [R] Unexpected input in function

2012-03-19 Thread Ted Harding
I think the most likely explanation is that something in the input string has had the effect of inserting an invisible "character" between the "-" and the "a" in "b-a", and a possible suspect is pollution by UTF8: see the discussion at http://r.789695.n4.nabble.com/unexpected-input-in-rpart-td3168

Re: [R] Coverage Probability

2012-03-19 Thread Jorge I Velez
Hi hubinho, This starts to look as homework to me so this will be my last try in helping you. The general strategy would be along the lines of (1) write a function that does what you want for a value of theta and (2) sapply() that function to the vector of theta values you would like to evaluate:

Re: [R] Unexpected input in function

2012-03-19 Thread R. Michael Weylandt
The OP's error suggests (to me) that there's a line break error somewhere so it may be a funny quirk of encoding/OS incompatibility if it's from a source()'d script. Incidentally, the OP could also write the body of his function as a one liner with: seq_along(a) - a Michael On Mon, Mar 19, 2012

Re: [R] hgu133plus2hsentrezgprobe library

2012-03-19 Thread Iain Gallagher
Hi Eleni Question like this are better served on the bioconductor mailing list. Nonetheless try this ALL <- topTable(fit2, coef=1, number=Inf) ALL$SYMBOL <- unlist(mget(ALL$ID, hgu133plus2hsentrezgSYMBOL, ifnotfound=NA)) Here ALL is the output from limma for differential expression (ALL$ID is t

Re: [R] Unexpected input in function

2012-03-19 Thread Sarah Goslee
I think you'll need to provide a reproducible example, because your code works for me: > fsubt <- function(a) { + b <- 1:length(a) + b-a + } > > > fsubt(1:5) [1] 0 0 0 0 0 > > fsubt(sample(1:10)) [1] -8 -6 1 1 -1 5 3 1 4 0 > > fsubt(2) [1] -1 On Mon, Mar 19, 2012 at 4:01 PM, Schryver, Ja

[R] Unexpected input in function

2012-03-19 Thread Schryver, Jack C.
Hi, Although the following statements work individually in R, they produce an error if placed inside a function as below: fsubt <- function(a) { b <- 1:length(a) b-a } The error message is: Error: unexpected input in: "b <- 1:length(a) b-" Any insight would be greatly appreciated. Thanks, Ja

Re: [R] Coverage Probability

2012-03-19 Thread hubinho
Thank you very much again. But in this case I get the coverage probability as an average over all values for the odds ratio. I need a coverage probability for every value for the odds ratio. So the coverage probability for odds ratio = 1, than for odds ratio = 2 and so on. Sorry to bother you ag

[R] Lag based on Date objects with non-consecutive values

2012-03-19 Thread Sam Albers
Hello all, I need to figure out a way to lag a variable in by a number of days without using the zoo package. I need to use a remote R connection that doesn't have the zoo package installed and is unwilling to do so. So that is, I want a function where I can specify the number of days to lag a var

Re: [R] Coverage Probability

2012-03-19 Thread Jorge I Velez
Hi hubinho, You need to initialize the for() loop and then store the u and l values properly: # parameters n1 <- 10 n2 <- 10 y <- 100 alpha <- 1 z<-1.96 # creating B 2x2 tables B <- 50 u <- l <- vector('numeric', B) for (i in 1:B){ theta <- i x1 <- exp(alpha +theta)/ (1+ exp(alpha +thet

Re: [R] Linear regression

2012-03-19 Thread Bert Gunter
Note that your equations can be written: y = alpha*A + (1-alpha)*B, which is equivalent to y = (A-B) * alpha + B , i.e. of form y = C*alpha + B a simple linear equation in alpha You have two different values of alpha at which y was measured, so just stack up all your results into a single

[R] [R-pkgs] acs package: analyze data from the U.S. American Community Survey

2012-03-19 Thread Ezra Haber Glenn
We are pleased to announce version 0.8 of the acs package for R, now available on CRAN (. The package provides a general toolkit for managing, analyzing, and presenting data from the U.S. Census American Community Survey (ACS). Confidence int

Re: [R] Coverage Probability

2012-03-19 Thread hubinho
Thank you very much. This was, was i needed. Unfortunately I have one futher problem with this Code. I don't only need the coverage probability for one but for a range of different odds ratios. (for example [1;30]). I tried it with a loop but I get an error. I think again, that I'm almost there but

Re: [R] Linear regression

2012-03-19 Thread Niloofar Javanrouh
hi I think You Can Use " solve" function to solve the equations.   ___  Niloofar.Javanrouh MSc Student Of BioStatistics Mashad University Of Medical Sciences   From: Bert Gunter To: Diviya Smi

Re: [R] Linear regression

2012-03-19 Thread Diviya Smith
Hello Bert, This is definitely not for a homework problem. I am trying to estimate frequencies of mutations in different groups. The mutation frequencies can be modeled as a linear relation in cases of mixtures. So I have a lot of populations that follow the relationship - y = alpha*A + beta*B an

Re: [R] Automaticall adjust axis scales

2012-03-19 Thread William Dunlap
Or look at the xlim and ylim arguments to plot. E.g., > x1 <- 1:10 ; x2 <- 11:17 ; x3 <- 21:23 > plot(NA, NA, xlim=range(1, length(x1), length(x2), length(x3)), > ylim=range(x1, x2, x3), type="n", xlab="", ylab="") > points(x1, type="b") > lines(x2) > points(x3) > title(xlab="The X Values", ylab

Re: [R] where this Error comes from?

2012-03-19 Thread Bert Gunter
?traceback ?options ## consider changing error option to recover ?debug Search on debugging in R to find more possibilities. R is a programming language. You need to learn how to debug code if you wish to program in R. -- Bert On Mon, Mar 19, 2012 at 12:22 PM, Alaios wrote: > Dear all, > While

Re: [R] where this Error comes from?

2012-03-19 Thread William Dunlap
Call traceback() after seeing the error message. E.g., > factor(list(1, 2:3, 4:6)) Error in sort.list(y) : 'x' must be atomic for 'sort.list' Have you called 'sort' on a list? > traceback() 3: stop("'x' must be atomic for 'sort.list'\nHave you called 'sort' on a list?") 2: sort.list(y)

Re: [R] where this Error comes from?

2012-03-19 Thread R. Michael Weylandt
I call upon the great and mighty Google (hallowed be its name) to discover: traceback() and its more powerful cousin options(error = recover) Michael On Mon, Mar 19, 2012 at 3:22 PM, Alaios wrote: > Dear all, > While I am executing my code I receive the error below > > Error in sort.int(x, na

[R] where this Error comes from?

2012-03-19 Thread Alaios
Dear all, While I am executing my code I receive the error below Error in sort.int(x, na.last = na.last, decreasing = decreasing, ...) :   'x' must be atomic the weird thing that I am not calling anywhere sort function nor do I rely on anyh sorting. How I can discover where this comes from (in

Re: [R] regression with proportion data

2012-03-19 Thread Peter Ehlers
On 2012-03-19 07:35, S Ellison wrote: -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Georgiana May Sent: 19 March 2012 14:06 To: r-help@r-project.org Subject: [R] regression with proportion data I understand that the binomial f

Re: [R] Automaticall adjust axis scales

2012-03-19 Thread Alaios
Thanks for the immediate answer. is ther any alternative for the matplot? There might few limitations with matplot in my case. I will post again if needed when I will be at office tomorrow. Regards Alex From: Jorge I Velez Cc: R help Sent: Monday, March 1

Re: [R] Automaticall adjust axis scales

2012-03-19 Thread Jorge I Velez
Perhaps matplot()? matplot(cbind(x1, x2, x3), type = 'l') See ?matplot for more information. HTH, Jorge.- On Mon, Mar 19, 2012 at 2:40 PM, Alaios <> wrote: > Dear all, > > I have made a function that given a number of list elements plot them to > the same window. > > The first element is plot

Re: [R] fitting a histogram to a Gaussian curve

2012-03-19 Thread Vihan Pandey
I'll check it out, thanks a million Micheal! On 19 March 2012 19:59, R. Michael Weylandt wrote: > Take a look at fitdistr in the MASS package. > > fitdistr(x, "normal") > > I don't think you need to supply start values for the normal since its > loglikelihood function is nicely behaved. You may n

Re: [R] Linear regression

2012-03-19 Thread Bert Gunter
1. Homework assignment? We don't do homework here. 2. If not, a mixture model of some sort? I suggest you state the context of the problem more fully. R has several packages to do mixture modeling, if that's what you're trying to do. 3. In any case, this cannot be done with lm() (at least withou

Re: [R] fitting a histogram to a Gaussian curve

2012-03-19 Thread R. Michael Weylandt
Take a look at fitdistr in the MASS package. fitdistr(x, "normal") I don't think you need to supply start values for the normal since its loglikelihood function is nicely behaved. You may need to for harder distributions. Michael On Mon, Mar 19, 2012 at 2:54 PM, Vihan Pandey wrote: > I see, th

Re: [R] fitting a histogram to a Gaussian curve

2012-03-19 Thread Vihan Pandey
I see, that could be an option, however isn't there a fitting function which would do that on given data? On 19 March 2012 19:49, R. Michael Weylandt wrote: > If I understand you correctly, a univariate Gaussian distribution is > uniquely determined by its first two moments so you can just fit th

Re: [R] Automaticall adjust axis scales

2012-03-19 Thread R. Michael Weylandt
I don't believe this is possible in base graphics: you need to plan your graphics ahead with something like plot(, ylim = range(x1, x2, x3)). There's a pen-and-paper approach which means once something is there, it's on the device permanently (unless you write over it). Perhaps an interactive graph

Re: [R] fitting a histogram to a Gaussian curve

2012-03-19 Thread R. Michael Weylandt
If I understand you correctly, a univariate Gaussian distribution is uniquely determined by its first two moments so you can just fit those directly (using sample mean for population mean and sample variance with Besel's correction for population variance) and get the "best" Gaussian (in a ML sense

[R] hgu133plus2hsentrezgprobe library

2012-03-19 Thread Eleni Christodoulou
Hello R community, I am processing raw Affymetrix CEL files and I am using the Michigan custom CDF library hgu133plus2hsentrezgprobe. I have been looking for documentation on the function that it contains...I am specifically interested in converting probe names to gene symbols. Does anybody know w

Re: [R] car/MANOVA question

2012-03-19 Thread John Fox
Dear Ranjan, As you no doubt noticed, the Manova() function in the car package, or the Anova() function for which Manova() is an alias, produces type II or III tests for a multivariate linear model. To compare two nested multivariate linear models, as you wish to do, you can use the standard R

[R] Automaticall adjust axis scales

2012-03-19 Thread Alaios
Dear all, I have made a function that given a number of list elements plot them to the same window. The first element is plotted by using plot and all the rest are plotted under the same window by using lines. I have below a small and simple reproducible example. x1<-c(1:10) plot(x1) x2<-

Re: [R] 'Unexpected numeric constant'

2012-03-19 Thread Peter Ehlers
On 2012-03-19 09:39, HJ YAN wrote: Dear R-help, I am trying to rename the variables in a dataframe, called 'T1A' here. Seems renaming was successful, but when I call one of the variable I got error message and I wanted to know why. The data frame contains 365 rows and 49 columns. I would like

[R] Linear regression

2012-03-19 Thread Diviya Smith
Hello there, I am new to using regression in R. I wanted to solve a simple regression problem where I have 2 equations and 2 unknowns. So lets say - y1 = alpha1*A + beta1*B y2 = alpha2*A + beta2*B y1 <- runif(10, 0,1) y2 <- runif(10,0,1) alpha1 <- 0.6 alpha2 <- 0.75 beta1 <- 1-alpha1 b

Re: [R] Rolling regressions with sample extended one period at a time

2012-03-19 Thread pie'
hey, thnks a lot. I got exactly what I wanted. -- View this message in context: http://r.789695.n4.nabble.com/Rolling-regressions-with-sample-extended-one-period-at-a-time-tp4470316p4485815.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] hypergeometric function in ‘ mvtnorm’

2012-03-19 Thread Berend Hasselman
On 19-03-2012, at 16:54, statfan wrote: > Thanks for your advice. I actually meant to ask about the "pmvt" for the > distribution function. Viewing the source code "pmvt" uses the function > "mvt" which uses the function "probval" which sources the fortran code: > No it doesn't "source". It

Re: [R] 'Unexpected numeric constant'

2012-03-19 Thread Berend Hasselman
On 19-03-2012, at 17:39, HJ YAN wrote: > Dear R-help, > > I am trying to rename the variables in a dataframe, called 'T1A' here. > Seems renaming was successful, but when I call one of the variable I got > error message and I wanted to know why. > > > The data frame contains 365 rows and 49 co

[R] car/MANOVA question

2012-03-19 Thread Ranjan Maitra
Dear colleagues, I had a question wrt the car package. How do I evaluate whether a simpler multivariate regression model is adequate? For instance, I do the following: ami <- read.table(file = "http://www.public.iastate.edu/~maitra/stat501/datasets/amitriptyline.dat";, col.names=c("TCAD", "drug"

Re: [R] Coverage Probability

2012-03-19 Thread Jorge I Velez
Hi hubinho, You are almost there. Try this slightly modification of your function: # theta, u and l are vectors of the same length foo <- function(theta, u, l) mean(theta >= l & theta <= u, na.rm = TRUE) foo(theta, u, l) HTH, Jorge.- On Mon, Mar 19, 2012 at 12:55 PM, hubinho <> wrote: > Hell

[R] Coverage Probability

2012-03-19 Thread hubinho
Hello. I'm allready this far. I have a function which is calculating the lower (l) and upper (u) limit for a confidence interval for the odds ratio. For example for 5 simulated 2x2 tables the upper and lower limits are: > u [1] 2.496141 7.436524 8.209161 4.313587 3.318612 > l [1] -0.9718608 1.1

Re: [R] hypergeometric function in ‘ mvtnorm’

2012-03-19 Thread statfan
Thanks for your advice. I actually meant to ask about the "pmvt" for the distribution function. Viewing the source code "pmvt" uses the function "mvt" which uses the function "probval" which sources the fortran code: Fortran("mvtdst", N = as.integer(n), NU = as.integer(df), LOWER = as.d

Re: [R] Output formatting in Latex and R

2012-03-19 Thread priyank
Use the eol="\n\n" option. The records should have a 2 line space. -- View this message in context: http://r.789695.n4.nabble.com/Output-formatting-in-Latex-and-R-tp4483631p4485457.html Sent from the R help mailing list archive at Nabble.com. __ R-help

Re: [R] Issue with asin()

2012-03-19 Thread Letnichev
Yes, with the same input I had two different outputs with Excel and R. When printing a debug report of Excel, it showed no anomalies and I am certain it didn't calculate odd values (such as NaNs). The way I coded was wrong, as Sarah said, I didn't follow completely the algorithm. The solution she s

Re: [R] Issue with asin()

2012-03-19 Thread Letnichev
Hello, you're totally right, I tried first to control the flow with "if (MaxDailyTemp > k & MinDailyTemp < k){statement}" but it was a bit messy. Then ifelse() was supposed to help me out, but it didn't. Thank you for your time, your code works exactly as I want :) P. -- View this message in co

Re: [R] Save File after order

2012-03-19 Thread MSousa
Thanks -- View this message in context: http://r.789695.n4.nabble.com/Save-File-after-order-tp4484539p4485370.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-hel

[R] 'Unexpected numeric constant'

2012-03-19 Thread HJ YAN
Dear R-help, I am trying to rename the variables in a dataframe, called 'T1A' here. Seems renaming was successful, but when I call one of the variable I got error message and I wanted to know why. The data frame contains 365 rows and 49 columns. I would like to name the first column `DATE` and t

[R] fitting a histogram to a Gaussian curve

2012-03-19 Thread Vihan Pandey
Hello, I am trying to fit my histogram to a smooth Gaussian curve(the data closely resembles one except a few bars). This is my code : #!/usr/bin/Rscript out_file = "irc_20M_opencl_test.png" png(out_file) scan("my.csv") -> myvals hist(myvals, breaks = 50, main = "My Distribution",xlab = "My V

Re: [R] glm: getting the confidence interval for an Odds Ratio, when using predict()

2012-03-19 Thread peter dalgaard
On Mar 19, 2012, at 03:32 , Dominic Comtois wrote: > Say I fit a logistic model and want to calculate an odds ratio between 2 > sets of predictors. It is easy to obtain the difference in the predicted > logodds using the predict() function, and thus get a point-estimate OR. But > I can't see how

[R] plm function

2012-03-19 Thread Millo Giovanni
Dear Ieva, plm(.., model="within") (which is the default for plm()) estimates a within model on time-demeaned data, which is "equivalent" to using the LSDV estimator. Therefore any time-constant dummy variable you add "by hand" will be discarded because of perfect collinearity. What kind of dummi

Re: [R] a very simple question

2012-03-19 Thread Petr Savicky
On Mon, Mar 19, 2012 at 12:47:12PM +, Dajiang Liu wrote: > > Thanks a lot for the clarification. I just find it very bizarre that if you > run a=0.1*(1:9);which(a==0.4) > it returns the right answer. Anyway, I will pay attention next time. Thanks a > lot. Hi. Yes, these things are bizarr

Re: [R] Dotplot: how to change size in the y lab ?

2012-03-19 Thread ilai
On Mon, Mar 19, 2012 at 7:56 AM, Jose Bustos Melo wrote: > Hi everyone, > > I'm trying to reduce the font size in the Y  exe in this plot: > dotplot( bank ~ MV2007 + MV2009 , data = d, horiz = T,  par.settings = list(  superpose.symbol = list(  pch = 21,  fill = c( "lightblue", "lightgreen"),  ce

Re: [R] Identifying a change in events between bins

2012-03-19 Thread Robert Baer
Your description was too general for me to know exactly what you want but perhaps this will help you solve your own problem set.seed(123) evtlist = sample(c('fwd','rev'),100,replace=TRUE) evtlist [1] "fwd" "rev" "fwd" "rev" "rev" "fwd" "rev" "rev" "rev" "fwd" "rev" "fwd" "rev" [14] "rev" "fwd"

Re: [R] a very simple question

2012-03-19 Thread Ted Harding
On 19-Mar-2012 Dajiang Liu wrote: > Thanks a lot for the clarification. I just find it very bizarre > that if you run > a=0.1*(1:9);which(a==0.4) > it returns the right answer. Anyway, I will pay attention next time. > Thanks a > lot. The basic explanation is that, for an integer r (0 Date: 19-Ma

[R] Google Summer of Code

2012-03-19 Thread John C Nash
Once again, R has been accepted as an organization for the Google Summer of Code (2012). We invite students interested in this program to learn more about it. A good starting point is http://rwiki.sciviews.org/doku.php?id=developers:projects:gsoc2012. The Google GSOC home page is http://www.goog

Re: [R] hypergeometric function in ‘ mvtnorm’

2012-03-19 Thread R. Michael Weylandt
To view the source of (most) functions, simply type funcname without parentheses: here, you get > dmvt function (x, delta, sigma, df = 1, log = TRUE, type = "shifted") { if (df == 0) return(dmvnorm(x, mean = delta, sigma = sigma, log = log)) if (is.vector(x)) { x <- matrix

Re: [R] what is p,d & q in arima() function of time series

2012-03-19 Thread R. Michael Weylandt
https://en.wikipedia.org/wiki/Autoregressive_integrated_moving_average You may also be interested in forecast:::auto.arima Michael On Mon, Mar 19, 2012 at 6:54 AM, sagarnikam123 wrote: > i am new to time series > i found in help about arima > arima(x = data, order = c(p, d, q)) > > > what is ex

Re: [R] regression with proportion data

2012-03-19 Thread S Ellison
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Georgiana May > Sent: 19 March 2012 14:06 > To: r-help@r-project.org > Subject: [R] regression with proportion data > > I understand that the binomial function concerns succes

Re: [R] Save File after order

2012-03-19 Thread Sarah Goslee
It doesn't have anything to do with your use of order(). Those are the row names of your data frame. You can disable writing them with the row.names=FALSE argument to write.table(). Sarah On Mon, Mar 19, 2012 at 8:16 AM, MSousa wrote: > Hello, > >     I'm trying to write the sorted data in a fil

Re: [R] Issue with asin()

2012-03-19 Thread Sarah Goslee
Hi, You're not following the algorithm as given. The asin step shouldn't be done for all values, but only for the ones that don't meet the previous conditions. You're trying to calculate that step for ALL values, then only use certain ones. You must instead subset the values, THEN calculate that s

Re: [R] regression with proportion data

2012-03-19 Thread Jorge I Velez
Hi Georgiana, Take a look at the betareg package at http://cran.r-project.org/web/packages/betareg/index.html HTH, Jorge.- On Mon, Mar 19, 2012 at 10:05 AM, Georgiana May <> wrote: > Hello, > I want to determine the regression relationship between a proportion (y) > and a continuous variable (

Re: [R] regression with proportion data

2012-03-19 Thread Rubén Roa
Your response variable is not binomial, it's a proportion. Try the betareg function in the betareg package, which more correctly assumes that your response variable is Beta distributed (but beware that 1 and 0 are not allowed). The syntax is the same as in a glm. HTH Ruben -Mensaje origina

Re: [R] a very simple question

2012-03-19 Thread Berend Hasselman
On 19-03-2012, at 13:47, Dajiang Liu wrote: > > Thanks a lot for the clarification. I just find it very bizarre that if you > run a=0.1*(1:9);which(a==0.4) > it returns the right answer. Anyway, I will pay attention next time. Thanks a > lot. > Look at > a = 0.1*(1:4) > a - 0.4 [1] -0.3

Re: [R] Issue with asin()

2012-03-19 Thread Berend Hasselman
On 19-03-2012, at 12:42, Letnichev wrote: > Hello everyone, > > I am working for a few days already on a basic algorithm, very common in > applied agronomy, that aims to determine the degree-days necessary for a > given individual to reach a given growth stade. The algorithm (and context) > is e

Re: [R] regression with proportion data

2012-03-19 Thread Doran, Harold
The logit link requires a binary response variable, not a proportion. Better bet is a beta regression. You can also do some stuff with linear regression if you do some transformations, but linear regression assumes the outcome is any number on the real number line bounded between -Inf and Inf.

Re: [R] Issue with asin()

2012-03-19 Thread Duncan Murdoch
On 12-03-19 7:42 AM, Letnichev wrote: Hello everyone, I am working for a few days already on a basic algorithm, very common in applied agronomy, that aims to determine the degree-days necessary for a given individual to reach a given growth stade. The algorithm (and context) is explained here:

[R] Dotplot: how to change size in the y lab ?

2012-03-19 Thread Jose Bustos Melo
Hi everyone, I'm trying to reduce the font size in the Y  exe in this plot: http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=150 Anyone knows how to do it? I have checked the argument lab.cex and cex, but any of these works! if you want to check us this code: ### read the data d

[R] regression with proportion data

2012-03-19 Thread Georgiana May
Hello, I want to determine the regression relationship between a proportion (y) and a continuous variable (x). Reading a number of sources (e.g. The R Book, Quick R,help), I believe I should be able to designate the model as: model<-glm(formula=proportion~x, family=binomial(link="logit")) this ru

Re: [R] a very simple question

2012-03-19 Thread Dajiang Liu
Thanks a lot for the clarification. I just find it very bizarre that if you run a=0.1*(1:9);which(a==0.4) it returns the right answer. Anyway, I will pay attention next time. Thanks a lot. > Date: Mon, 19 Mar 2012 08:59:59 +0100 > From: rainer.schuerm...@gmx.net > Subject: Re: [R] a very simp

[R] fitted values with locfit

2012-03-19 Thread Soberon Velez, Alexandra Pilar
Dear memberships, I'm trying to estimate the following multivariate local regression model using the "locfit" package: BMI=m1(RCC)+m2(WCC) where (m1) and (m2) are unknown smooth functions. My problem is that once I get the regression done I cannot get the fitted values of each of this smoo

[R] Save File after order

2012-03-19 Thread MSousa
Hello,     I'm trying to write the sorted data in a file of a data.frame, My question and my problem is that when I record in file adds a new column row.name, which apparently is the original position in the file.     I wanted to write to the file without this column x<-data.frame(name="x1",Time=

[R] How to cluster/classify following time series?

2012-03-19 Thread sagarnikam123
how to cluster/classify attached time series ?(each column/time series consider as single unit while clustering/classifying) & if my concept is wrong,tell me how to extract time series with highest information content ? given file is to do it http://r.789695.n4.nabble.com/file/n4484173/rasta.txt

[R] what is p,d & q in arima() function of time series

2012-03-19 Thread sagarnikam123
i am new to time series i found in help about arima arima(x = data, order = c(p, d, q)) what is exactly p,d,q? if i not changed them,what effects will happens? -- View this message in context: http://r.789695.n4.nabble.com/what-is-p-d-q-in-arima-function-of-time-series-tp4484368p4484368.html Se

  1   2   >