[R] Error : Error in if (antipodal(p1, p2))

2012-11-24 Thread shabsae
Hey, I'm trying to build something like this http://flowingdata.com/2011/05/11/how-to-map-connections-with-great-circles/ but with my own data in csv files. The code runs well if I use the same csv files as the author, but with mine , this is what I get *Code* library(maps) library(geosphere)

[R] Multiple Range Means Test

2012-11-24 Thread Amanda Jones
Hello, My boss wants me to do a Duncan's test, which is under the agricolae package. Unfortunately I am not versed enough in R to run my data. I have 7 subspecies of deer mouse for which I have 23 measurements which are my variables of interest. I have run an ANOVA for each of the set of subspecie

Re: [R] Comparing linear regression coefficients to a slope of 1

2012-11-24 Thread Bert Gunter
Catriona: You have already been roundly (and appropriately) chastised for your sins. So I need not join the chorus. Instead, let me just briefly focus on the substance of what you are trying to do, because I continue to believe it's wrong. Here's the leading question: Could you just as logicall

Re: [R] Comparing linear regression coefficients to a slope of 1

2012-11-24 Thread David Winsemius
BTW that plot is ridiculous. You should be plotting using the coefficients from the non-offset model, since that is the real data model. On Nov 24, 2012, at 6:05 PM, Catriona Hendry wrote: Hi, @ Albyn, David.. No, its not homework. Its basic groundwork for testing allometric relationshi

Re: [R] Comparing linear regression coefficients to a slope of 1

2012-11-24 Thread Catriona Hendry
Hi Albyn, Not a problem :) I had calculated the CI using >confint(Regression_PhyloContrasts, level=0.95) Is that adequate? I had been using this as my indicator of significance, but ultimately I need a P-value for the deviation from a slope of 1. Which is where I ran into trouble trying to use

[R] How to map new data to the existing cluster assignments in R mclust?

2012-11-24 Thread Zoe
I need to map new data to the existing cluster assignments in R. For clustering was used mclust. I need to find which cluster the new data belong to. Asking for a help :) -- View this message in context: http://r.789695.n4.nabble.com/How-to-map-new-data-to-the-existing-cluster-assignments-in-R

Re: [R] Help!!!!!

2012-11-24 Thread anoumou
Hello, Thank you very much for your help. I appreciate. :-) I want the count of INCUBATION and CONTAGIEUX to be by country. the count for example of mexique must not be the same as for USA. Have u an idea? Thanks you in advance. anoumou -- View this message in context: http://r.789695.n4.nab

Re: [R] Comparing linear regression coefficients to a slope of 1

2012-11-24 Thread Albyn Jones
Dear Cat My apologies for presuming... Here's a "primitive" solution: compute a t-statistic or CI. t = (beta-hat - 1)/SE(beta-hat), compare to qt(.975, res.df) Or Better, compute the 95% confidence interval beta-hat + c(-1,1)*qt(.975, res.df)*SE(beta-hat) albyn On 2012-11-24 18:05, Catri

Re: [R] How to Label Cases in Scatterplots?

2012-11-24 Thread Jim Lemon
On 11/25/2012 03:04 AM, john55 wrote: Hi everyone, i´m trying to graphically display distributions with r and i´m working with makrodata from the WVS. the command i´m using is plot (Makrodata$v11, Makrodata$v12, xlab="Democracy Score Economist", ylab= share religious people") i´m having an

[R] Bayes Logit

2012-11-24 Thread Tjun Kiat Teo
I tried to use mlogit.R in the package Bayes Logit and got this error message Error in .C("rpg_devroye", x, as.integer(n), z, as.integer(num), PACKAGE = "BayesLogit") : C symbol name "rpg_devroye" not in DLL for package "BayesLogit) Can anyone help? Thanks Tjun Kiat [[alternative HTM

Re: [R] printing difftime summary

2012-11-24 Thread Sam Steingold
> * David Winsemius [2012-11-23 13:14:17 -0800]: > >>> See >>> http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-should-I-write-summary-methods_003f --8<---cut here---start->8--- summary.difftime <- function (v) { s <- summary(as.numeric(v)) r <- as.data.fr

Re: [R] Iterate by Factor - Newbie Question

2012-11-24 Thread jim holtman
Hard to tell without the rest of the data. You can probably use 'merge' to add the data from the second file to the first. If you want printed pages, then you can just have a 'for' loop that goes through the dataframe creating the lines of output you want on the report and then insert a 'form fee

Re: [R] Comparing linear regression coefficients to a slope of 1

2012-11-24 Thread David Winsemius
On Nov 24, 2012, at 6:05 PM, Catriona Hendry wrote: Hi, @ Albyn, David.. No, its not homework. Its basic groundwork for testing allometric relationships for a graduate project I am working on. I read the guide before posting, I spent half the day trying to understand how I am going wron

Re: [R] Comparing linear regression coefficients to a slope of 1

2012-11-24 Thread Catriona Hendry
Hi, @ Albyn, David.. No, its not homework. Its basic groundwork for testing allometric relationships for a graduate project I am working on. I read the guide before posting, I spent half the day trying to understand how I am going wrong based on the advice given to others. @Bert, David... I apolo

Re: [R] Comparing linear regression coefficients to a slope of 1

2012-11-24 Thread David Winsemius
On Nov 24, 2012, at 4:27 PM, Catriona Hendry wrote: Hi! I have a question that is probably very basic, but I cannot figure out how to do it. I simply need to compare the significance of a regression slope against a slope of 1, instead of the default of zero. I know this topic has been po

Re: [R] Designating a new year (Sept-Aug) in R

2012-11-24 Thread arun
HI, If you need to order the dates. dat1<-read.table(text=" site,date,precipitation,temp_max,temp_min Castle Peak,January-70,0,32,18 Castle Peak,January-70,0,39,9 Castle Peak,September-70,0,34,5 Castle Peak,September-70,0,30,7 Castle Peak,October-70,0,40,6 Castle Peak,November-70,0,45,10 Castle Pe

Re: [R] Comparing linear regression coefficients to a slope of 1

2012-11-24 Thread Bert Gunter
1. The model is correct : lm( y~ x + offset(x)) ( AFAICS) 2. Read the posting guide, please: Code? I do not know what you mean by: " this resulted in a regression line that was plotted perpendicular to the data when added with the abline function." Of course, maybe someone else will groc this.

Re: [R] Comparing linear regression coefficients to a slope of 1

2012-11-24 Thread Albyn Jones
Is this homework? PLEASE do read the posting guide http://www.R-project.org/posting-guide.html albyn On Sat, Nov 24, 2012 at 07:27:25PM -0500, Catriona Hendry wrote: > Hi! > > I have a question that is probably very basic, but I cannot figure out how > to do it. I simply need to

[R] Iterate by Factor - Newbie Question

2012-11-24 Thread Thomas Ottaway
I have end of semester teaching evaluation data of the following form: > head(evaluations) Course Prefix Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10 Q11 Q12 Q13 Q14 1 2330301 2 4 3 3 3 4 4 1 2 5 4 1 1 1 1 2 2330301 2 3 3 3 3 3 5 1 2 5 8 1 1 1 1 3 2330301

[R] Comparing linear regression coefficients to a slope of 1

2012-11-24 Thread Catriona Hendry
Hi! I have a question that is probably very basic, but I cannot figure out how to do it. I simply need to compare the significance of a regression slope against a slope of 1, instead of the default of zero. I know this topic has been posted before, and I have tried to use the advice given to othe

Re: [R] IMPORTANT!!!! PLEASE HELP ME

2012-11-24 Thread Pete Brecknock
Jasmin wrote > I try to use hansen-hurwitz and horvitz-thompson estimator.So I should > generate samples which come from normal distribution (mu=50,sigma=3). I have taken the liberty of scaling the problem down to something more digestible and have changed lines 5 and 7 in your code nsamples=10 s

Re: [R] Summary statistics for matrix columns

2012-11-24 Thread David Winsemius
On Nov 24, 2012, at 4:58 AM, frespider wrote: HI A.k, I need one more question, if you can answer it please M <- matrix(sample(1:8000),nrow=100) colnames(M)<- paste("Col",1:ncol(M),sep="") apply(M,2,function(x) c(Min=min(x),"1st Qu" =quantile(x, 0.25,names=FALSE),

Re: [R] Comparing the Means of Two Normal Distributions

2012-11-24 Thread Greg Snow
You have all the information that you need to do the pooled t-test using the formula in many intro stats textbooks and probably on wikipedia as well, just plug your numbers into the formulas in the book (R can act as the calculator to make this easier). Or sometimes simpler (for the human, the com

Re: [R] IMPORTANT!!!! PLEASE HELP ME

2012-11-24 Thread Pete Brecknock
jholtman wrote > What do you want to do with the samples after you generate them? What > are the parameters for the normal distribution? You left a lot of > information out. You can generate 500,000 numbers and then store them > in a 1x50 matrix quite easily. > > On Sat, Nov 24, 2012 at 5:0

Re: [R] Adding a new variable to each element of a list

2012-11-24 Thread arun
HI, The example data you gave have only one row for the 1st element of list.  So, it would be better to add it as:  lapply(result,function(x) {x[[2]]<-y  return(x)}) #$`Error: subject` #Component 1 :  #     Df Sum Sq Mean Sq F value Pr(>F) #Residuals  4   12.4 3.1   # #Compon

Re: [R] Designating a new year (Sept-Aug) in R

2012-11-24 Thread Rui Barradas
Hello, I don't know if this is it, do you want a 4 digit year or month-yy? The following function returns month-yy. fun <- function(x, format = "%B-%y"){ fmt <- format x <- as.Date(paste("01", x, sep = "-"), format = paste("%d", fmt, sep = "-")) m <- as.integer(format(x, "%m"))

Re: [R] Designating a new year (Sept-Aug) in R

2012-11-24 Thread arun
Hi, Try this: dat1<-read.table(text=" site,date,precipitation,temp_max,temp_min Castle Peak,January-70,0,32,18 Castle Peak,January-70,0,39,9 Castle Peak,September-70,0,34,5 Castle Peak,September-70,0,30,7 Castle Peak,October-70,0,40,6 Castle Peak,November-70,0,45,10 Castle Peak,December-70,0,43,8 C

[R] Adding a new variable to each element of a list

2012-11-24 Thread Stephen Politzer-Ahles
Hello, I have a list of data with multiple elements, and each element in the list has multiple variables in it. Here's an example: ### Make the fake data dv <- c(1,3,4,2,2,3,2,5,6,3,4,4,3,5,6) subject <- factor(c("s1","s1","s1","s2","s2","s2","s3","s3","s3", "s4","s4","s4","s5","s5","s5")) myfact

[R] Grouped data objects within GLS and Variogram

2012-11-24 Thread Matlack, Glenn
Dear R Help, I am having difficulty using Variogram within GLS to examine spatial structure of nested data. My data frame consists of ecological measurements of a forest, in which three landscape positions ("landposi") are compared. Each landscape position is replicated five times ("replicat"

Re: [R] IMPORTANT!!!! PLEASE HELP ME

2012-11-24 Thread chuck.01
1st. Calm down, this doesn't seem that important. Then you will need to know some base functions. see ?rnorm Doing this 10,000 times and making them of size 50 is no problem. FYI: I don't understand what "with replacement case" means; could you clarify? Jasmin wrote > Hi, > I want to gener

Re: [R] Help!!!!!

2012-11-24 Thread Rui Barradas
Hello, Right, sorry, it should be nrow(x). I had created a variable nr <- nrow(x) and forgot to check it after changing it. incub <- function(x){ x$Incubation <- 0 x$Incubation[1] <- x$Symptomes[1] if(nrow(x) > 1) x$Incubation[2] <- sum(x$Symptomes[1:2]) for(i in seq_l

[R] Please help me

2012-11-24 Thread emable_wahid
i want to generate an odf report using R, the report is generated but the run stop just after the instruction: odfWeave(inputFile,outputFile) and i get this error: Error in odfWeave(inf, outf) : Error removing work dir please help me it's an emergency. thanks -- View this message in context:

[R] Designating a new year (Sept-Aug) in R

2012-11-24 Thread nick pardikes
If I have data (below) and need some help in figuring out how I can change the values of my date column, so that a year will be from September-August? So the year 1990 = September 89-August 90; 1991 = September 90-August 91, etc... I was trying to use the if() function, but am unable to figur

Re: [R] Coefficient of determination for non-linear equations system (nlsystemfit)

2012-11-24 Thread Arne Henningsen
Dear Antti On 20 November 2012 10:24, Antti Simola wrote: > I have estimated system of three linear equations with one non-linear > restrictions with nlsystemfit. Please read the FAQ at http://www.systemfit.org/ > I was wondering how I can calculate the > R-squared (or some alternative coeffici

Re: [R] A Question About Plotting

2012-11-24 Thread Richard M. Heiberger
Marcus, Best guess is one of those variables is a factor and you are thinking it is numeric. Please use dput(head(Jitirana)) and send the resulting exeutable statement. Please control your email so that the lines are properly transmitted. Your entire email came as one paragraph. Please read

Re: [R] How to Label Cases in Scatterplots?

2012-11-24 Thread Richard M. Heiberger
Johannes, This will get you started tmp <- data.frame(x=rnorm(10), y=rnorm(10, 1000, 100), txt=letters[1:10]) plot(y ~ x, data=tmp) text(x=tmp$x+.05, y=tmp$y-20, labels=tmp$txt) rect(tmp$x-.05, tmp$y-25, tmp$x+.1, tmp$y-10) Rich You will probably need to use the xlim and ylim arguments on the

[R] robustbase error message

2012-11-24 Thread Torvon
Hey there. I am running a multiple regression and want to see whether a robust regression would provide different results, since there is some heteroscedasticity and other minor violations of regression assumptions. When I run the model using the robustbase package, > modelrob=lmrob(m1) I receiv

[R] bootstrap lmekin model

2012-11-24 Thread Roberta Carriero
Hi,I use the 'lmekin' model of the 'kinship' package of R in order to estimate heritability. I want to estimate the confidence interval of the variance coefficient and so I should use a bootstrap simulation. The pedigree file has 1386 subjects so I create a kinship matrix [1386*1386].This is th

[R] Bootstrap lmekin model

2012-11-24 Thread Roberta Carriero
Hi,I use the 'lmekin' model of the 'kinship' package of R in order to estimate heritability. I want to estimate the confidence interval of the variance coefficient and so I should use a bootstrap simulation. The pedigree file has 1386 subjects so I create a kinship matrix [1386*1386].This is th

Re: [R] Summary statistics for matrix columns

2012-11-24 Thread arun
Hi, You are right.  Range is supposed to be one value (i.e the difference between largest and smallest).  For some reason, the function range(x) gives both the values. The description for ?range() is: "Description:      ‘range’ returns a vector containing the minimum and maximum of all    

Re: [R] Help!!!!!

2012-11-24 Thread Rui Barradas
Hello, Try the following. incub <- function(x){ x$Incubation <- 0 x$Incubation[1] <- x$Symptomes[1] if(nr > 1) x$Incubation[2] <- sum(x$Symptomes[1:2]) for(i in seq_len(nrow(x))[-(1:2)]) x$Incubation[i] <- sum(x$Symptomes[i - (0:2)]) x } contag <- function(x){

[R] A Question About Plotting

2012-11-24 Thread Marcus Tullius
Hallo there, I've got a simple question concerning a plot attempt of mine. I am trying to plot two variables using the following code: # Creating a Graph attach(Jitirana) plot(Sozialkapital, Migration) abline(lm(Migration~Sozialkapital)) title("Regression of Sozialkapital on Migration") Simple

[R] Does R has any SVG devices that allow setting of zooming and panning (in addition to Tooltips and Hyperlinks) ?

2012-11-24 Thread chakri
This question is in continuation to the one posted in StackOverflow : http://stackoverflow.com/q/13542480/1029725 Thanks in Advance Ch -- View this message in context: http://r.789695.n4.nabble.com/Does-R-has-any-SVG-devices-that-allow-setting-of-zooming-and-panning-in-addition-to-Tooltips-and

Re: [R] characters, mathematical expressions and computed values

2012-11-24 Thread David Winsemius
On Nov 24, 2012, at 5:20 AM, mee1d3hs wrote: I still can't get this to work, I sent a message yesterday that indicated that one of you earlier attempts was successful on my machine running the same (or roughly the same OS) and a current version of R. You seem to be ignoring the possibil

Re: [R] Building factors across two columns, is this possible?

2012-11-24 Thread David Winsemius
On Nov 23, 2012, at 8:42 PM, Brian Feeny wrote: I am trying to make it so two columns with similar data use the same internal numbers for same factors, here is the example: read.csv("test.csv",header =FALSE,sep=",") V1V2 V3 1 sun moonstars 2 stars moon sun 3

Re: [R] characters, mathematical expressions and computed values

2012-11-24 Thread William Dunlap
My message much earlier in the thread was > I think that bquote, with its .() operator, suffices for [almost?] any single title; > don't bother fiddling with expression(), substitute(), or parse(). (You can make > those work in many situations, but if you stick with just bquote then you

Re: [R] Performing operations only on selected data

2012-11-24 Thread Jeff Newmiller
?ifelse --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Enginee

Re: [R] Summary statistics for matrix columns

2012-11-24 Thread William Dunlap
> isn't range mean the different between the max and min That is one meaning of "range". There are many. To see what R's definition is type ? range or help("range") Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Message- > From: r-help-boun...@r-project.org [

[R] Help!!!!!

2012-11-24 Thread anoumou
Dear R users. I am little lost and i need your help. I have such data. DATE i Symptomes t 1 2009-04-24 Mexique 0 14358 2 2009-04-24 usa 0 14358 3 2009-04-26 Mexique18 14360 4 2009-04-26 us

[R] How to Label Cases in Scatterplots?

2012-11-24 Thread john55
Hi everyone, i´m trying to graphically display distributions with r and i´m working with makrodata from the WVS. the command i´m using is > plot (Makrodata$v11, Makrodata$v12, xlab="Democracy Score Economist", > ylab= share religious people")

[R] Performing operations only on selected data

2012-11-24 Thread Marcel Curlin
I spent some time on this simple question, also searched the forum, eventually hacked my way to an ugly solution for my particular problem but I would like to improve my coding: I have data of the form: df <- expand.grid(group=c('copper', 'zinc', 'aluminum', 'nickel'), condition1=c(1:4)) I would

Re: [R] characters, mathematical expressions and computed values

2012-11-24 Thread mee1d3hs
I still can't get this to work, I am just trying to learn and this is supposed to be a feature of R, the ability to combine math notation in charts and exhibits I did some more work to try to show what I am trying it to and what is not working x <- rnorm(1000,mean=10,sd=2) par(mfcol=c(3,3))

Re: [R] R lapack routines cannot be loaded

2012-11-24 Thread arysar
Yes I read that link but I have lapack version 3.3.1-1: Paquete: liblapack3gf Nuevo: sí Estado: instalado Instalado automáticamente: sí Versión: 3.3.1-1 Prioridad: opcional Sección: libs Desarrollador: Ubuntu Developers Arquitectura: i386 Tamaño sin comprimir: 8.098 k Depende de: debconf (>= 0.5

Re: [R] Summary statistics for matrix columns

2012-11-24 Thread frespider
HI A.k, I need one more question, if you can answer it please M <- matrix(sample(1:8000),nrow=100) colnames(M)<- paste("Col",1:ncol(M),sep="") apply(M,2,function(x) c(Min=min(x),"1st Qu" =quantile(x, 0.25,names=FALSE), Range = range(x), Median = q

[R] Error in Random Effect Panel

2012-11-24 Thread Hard Core
I tried to run a Random effect Panel regression and i get this error: Errore in swar(object, data, effect) : the estimated variance of the individual effect is negative > can you help me trying to understand the problem? (sorry for m bad english) Thanks to everybody -- View this message in

Re: [R] postForm() in RCurl and library RHTMLForms

2012-11-24 Thread veepsirtt
Why I am getting this error? Error in getHTMLFormDescription(docNifty)[[1]] : subscript out of bounds -- View this message in context: http://r.789695.n4.nabble.com/postForm-in-RCurl-and-library-RHTMLForms-tp3026742p4650636.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] Building factors across two columns, is this possible?

2012-11-24 Thread Rui Barradas
Hello, If you want the factor sorted, you'll have to do it manually. levs <- sort(unique(as.character(unlist(dat Rui Barradas Em 24-11-2012 12:57, Rui Barradas escreveu: Hello, You can do what you want, but the coding of factors starts at 1 not at 0. dat <- read.table(text=" V1V2

Re: [R] daily maximum temperature

2012-11-24 Thread arun
Hi, If I understand your question, this would do it: z2<-transform(z2,Hr=format(index(z2),"%H"))  z2 #    Ta   HR  RS v   Hr #2010-01-01 11:00:00 5.51 100 0  1.1 11 #2010-01-02 11:00:00 5.64 100 0  2.4 11 #2010-01-03 06:00:00 5.40 100 0  2.3 06 A.K. - Original Message -

Re: [R] SEM raw moment matrix

2012-11-24 Thread John Fox
Dear Maya, I think that what you've done should work fine, though I'm not sure why you created your own UNIT variable rather than allowing sem() to generate the constant. Best, John On Sat, 24 Nov 2012 10:33:50 +0200 Maya Abou Zeid wrote: > Dear John, > > Many thanks for your response. > I

Re: [R] Building factors across two columns, is this possible?

2012-11-24 Thread Rui Barradas
Hello, You can do what you want, but the coding of factors starts at 1 not at 0. dat <- read.table(text=" V1V2 V3 1 sun moonstars 2 stars moon sun 3 cat dog catdog 4 dog moon sun 5 bird plane superman 6 1000 dog 2000 ", header = TRUE) levs <- unique

Re: [R] function call from another r file

2012-11-24 Thread Barry Rowlingson
On Sat, Nov 24, 2012 at 12:26 PM, Suzen, Mehmet wrote: > If you want to handle a generic case, best thing is to create an R > package. And better than best is to use devtools to save you a fiddly edit/build/install cycle. You don't even have to think of it as a package, its just a folder called R

Re: [R] function call from another r file

2012-11-24 Thread Suzen, Mehmet
If you want to handle a generic case, best thing is to create an R package. It is much easier to manage that using source(), if you have lots of different functionality and data files. Also look at ?system.file. On Sat, Nov 24, 2012 at 7:49 AM, Jeff Newmiller wrote: > It is straightforward to loa

Re: [R] Student-t distributed random value generation within a confidence interval?

2012-11-24 Thread Thomas Schu
allvals <- rt(1000,df=11) ## 1000 samples is overkill: slightly more than ##500*(1.05) should be large enough subvals <- (allvals[abs(allvals) Thank you very much bbolker. It works very well! Best regards Thomas -- View this message in context: http://r.789695.n4.nabble.com/Student-t-

Re: [R] Results displayed in Console

2012-11-24 Thread Anthony Damico
# load example linear model from ?lm ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14) trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69) group <- gl(2,10,20, labels=c("Ctl","Trt")) weight <- c(ctl, trt) lm.D90 <- lm(weight ~ group - 1) # omitting intercept # store the summary()

Re: [R] SEM raw moment matrix

2012-11-24 Thread Maya Abou Zeid
Dear John, Many thanks for your response. I'd just still like to double check that I have indeed used the raw moment matrix method correctly in sem. In my model, some equations are in deviations form and have no intercept, while some have intercept. sem.QT.1 <- sem(mod.QT.1, data=QTrav, formul

[R] How to discretize the Variance Gamma Process for stock price simulation?

2012-11-24 Thread Maximilian Lklweryc
Hi, I want to do stock price simulation. First of all, I used the geometric brownian motion. To simulate the values, I used not the closed form solution for the GBM given by: S_t=S_0*exp[(μ−σ^2)t+σWt] but the discrete version, so I can "see" every day realization: S_i+1=μΔt∗S_i+σφΔt∗S_i+S_i No

Re: [R] R lapack routines cannot be loaded

2012-11-24 Thread Prof Brian Ripley
This was answered this week in https://stat.ethz.ch/pipermail/r-help/2012-November/329946.html On 23/11/2012 16:05, arysar wrote: I usually ran different statistical analysis in R with routines that use lapack like gam() lm(), etc but after several updates of libraries the following error appea