[R] R coding to extract allele frequencies from NCBI for ALL alleles of one SNP?

2024-11-15 Thread Clark Jeremy
Dear All, The following code extracts from NCBI very nice output for ONE allele of a SNP (often the allele with the second largest frequency - usually termed the minor allele). It gives an average minor allele frequency from all NCBI sources (which is what I want, except I'd like the addition o

[R] simplifying output of mapply

2017-02-08 Thread jeremy adler
ggplot(p,aes(v2))+geom_density(aes(x=v2,fill=v1))+geom_histogram(aes(y=..density..),alpha=.5)+ theme(legend.position="none") g<-g+xlab(x) return(g) } m<-mapply(FUN=plt,x=c("spot_001"),y=c("Cell.Median.CD3")) So I just want the graphs (g) to be

Re: [R] Graphs for scientific publication ?

2015-06-03 Thread Jeremy Clark
The coding I've settled on to save file without clipping is: library(gridExtra) gt <- ggplot_gtable(ggplot_build(q3)) gt$layout$clip[gt$layout$name=="panel"] <- "off" gt4 <- arrangeGrob(gt) ggsave <- ggplot2::ggsave; body(ggsave) <- body(ggplot2::ggsave)[-2] ## from Baptiste ggsave("gt.pdf", plot

[R] Integration using nlsLM ?

2015-06-03 Thread Jeremy Clark
Dear All - I'm trying to integrate the following function via nlsLM - and I think the problem is something to do with passing the correct arguments (error is given below) - any help gratefully appreciated - many thanks. library(minpack.lm) dOM <- function(x, mu = 0, sigma = 1, log = FALSE) {

Re: [R] Graphs for scientific publication ?

2015-05-04 Thread Jeremy Clark
ecently updated including IOS 8.2, OS X 10.10, Xcode 6.2. I previously, and fairly recently, installed X11 (and Xquartz), and also updated R and R Cairo, but none of this has affected the above behaviour. Any advice gratefully received. Yours sincerely, Jeremy Clark library(ggplot2) library(grid

[R] Graphs for scientific publication ?

2015-04-30 Thread Jeremy Clark
Dear All, First of all, many thanks to all R contributors for a fantastic program, and especially to Hadley Wickham for creating ggplot2. The following is intended to be a warning that, if the apparently superficial problems described are not sorted out, R could well find itself being superceded.

[R] R match - could be improved ?

2015-03-15 Thread Jeremy Clark
​Dear All, The following gives a very unpleasant experience with apparently random NAs - probably it's my bad formatting of the coding - but the effect is unexpected and if undetected can lead to considerable problems: myvector1 = NULL myvector3 = NULL myvector4 = NULL myvector5 = NULL myve

[R] Difference betweeen cor.test() and formula everyone says to use

2014-10-16 Thread Jeremy Miles
2] > r.z <- fisherz(r) > se <- se <- 1/sqrt(10 - 3) > z <- r.z / se > (1 - pnorm(z))*2 [1] 0.04237039 My p-value is different. The help file for cor.test doesn't (seem to) have any reference to this, and I can see in the source code that it is doing somet

[R] mice - undefined columns selected

2014-09-11 Thread Jeremy Miles
data, , jj) : undefined columns selected I hope I'm doing something foolish, thanks, Jeremy [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting gu

Re: [R] metafor package: changing decimal in forest plot to midline decimal

2014-07-07 Thread Jeremy Miles
I've found that if you want really fine control over an issue like this in a chart, the easiest thing to do is to export it as PDF, and then directly edit the chart in Illustrator (not free) or Inkscape (free). On 7 July 2014 10:21, Viechtbauer Wolfgang (STAT) < wolfgang.viechtba...@maastrichtu

Re: [R] R for Android

2014-05-08 Thread Jeremy Miles
It exists: https://play.google.com/store/apps/details?id=com.appsopensource.R No graphics. Jeremy On 8 May 2014 05:44, Kevin E. Thorpe wrote: > This is a question asked purely out of idle curiosity (and may also be in > wrong list). Are there plans for porting R to Android devi

Re: [R] Lavaan Model Specification

2014-04-30 Thread Jeremy Miles
lCallBehav ~~ congressmenPerceptConstiuentAttitudes rollCallBehav ~~ congressmanAttitudes And your model runs, with 0 df. Your latent variable does nothing, becuase you only only have one variable which relates to it. Jeremy P.S. There's a lavaan group on google groups. On 30 April 2014 08:02, Patzelt

Re: [R] lavaan fit indices & Chronbach's alphas

2014-03-26 Thread Jeremy Miles
nt models present? > > No. Cronbach's alpha is tangentially related to SEM. Do you mean composite reliability? That's not automatic either, but it can be programmed. Jeremy [[alternative HTML version deleted]] __ R-help@r-project.o

Re: [R] Passing vectors through a dataframe

2014-02-07 Thread Jeremy Clark
ng ?? maxtrundx maxtrundx <- mylist[[maxr[[1 ## incorrect - gives wrong vector maxtrundx ## The question is - how can I select the correct vector from the list (ie.F4287) using an object extracted from the dataframe (eg. maxr or maxr2) ?? On Thu, Feb 6, 2014 at 6:20 PM, Dunc

[R] Passing vectors through a dataframe

2014-02-06 Thread Jeremy Clark
Dear All, I would like to be able to associate a list of vectors (one vector of which is to be called later) with some other character and numeric data. I've tried two methods: 1) I can put the vector names in quotes into the dataframe, and then extract the vector name - but this is just a charac

Re: [R] Functions in formulae ??

2013-11-26 Thread Jeremy Clark
t data plot(gg, dd10, main = "modLM4") ## plot fitted values lines(gg, fitted(modLM4), col = 2, lwd = 2) On Thu, Nov 21, 2013 at 11:57 AM, Jeremy Clark wrote: > Dear All, > > In the following simple case I can't seem to get an improved fit, > despite trying all of the

Re: [R] Functions in formulae ??

2013-11-26 Thread Jeremy Clark
values lines(gg, fitted(modLM4), col = 2, lwd = 2) On Thu, Nov 21, 2013 at 11:57 AM, Jeremy Clark wrote: > Dear All, > > In the following simple case I can't seem to get an improved fit, > despite trying all of the control possibilities. As there seem to be > no examples any

[R] Functions in formulae ??

2013-11-21 Thread Jeremy Clark
Dear All, In the following simple case I can't seem to get an improved fit, despite trying all of the control possibilities. As there seem to be no examples anywhere which show use of functions such as "dnorm" within a formula, and as I am not confident at all that my formula is correctly configur

[R] Replacing strings to numbers

2013-07-02 Thread Jeremy Ng
not necessarily AA,AT, or TT. Any ideas? Thanks! Jeremy [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting

[R] Loading an .RData file and assigning the loaded objects within a loop

2013-06-01 Thread Jeremy Ng
workspace object name. Is there anyway for each individually read in Rdata object to be assigned a new name? Thanks! JEremy [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] Converting code to R Question

2013-02-25 Thread Jeremy Miles
2 == 1) , (item3 == 1) , (item4 == 1), na.rm=TRUE) Jeremy On 25 February 2013 17:02, Craig J wrote: > I'm learning R and am converting some code from SPSS into R. My background > is in SAS/SPSS so the vectorization is new to me and I'm trying to learn > how to NOT use loops.

[R] Multidimensional interpolation

2013-02-25 Thread Jeremy Beaulieu
27;ve looked into several packages and none seem to interpolate across more than 3-dimensions. All the best, Jeremy Beaulieu __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://

Re: [R] MIMIC latent variable with PLS Path Modelling with R ?

2013-02-16 Thread Jeremy Miles
By MIMIC do you mean multiple indicator/multiple cause? Something like this: http://www.jeremymiles.co.uk/misc/fun/img059.gif If so, you can use sem, Lavaan, or openMx. Jeremy On 13 February 2013 05:11, Hervé Guyon wrote: > I want estimate MIMIC latent variable with R in a Monte Ca

Re: [R] Interpret R-squared and cor in R

2013-02-15 Thread Jeremy Miles
ese values while > writing a report ? > > I can suggest a number of books that do this much better than I could in an email. But you probably have a favorite of your own. Jeremy [[alternative HTML version deleted]] __ R-help@r-projec

[R] Rcmdr, RODBC and XLConnect conflict cause R to crash

2013-02-14 Thread Jeremy MAZET
Dear all, Since I upgraded R to the version 2.15.2, I have a strange problem which implies XLConnect, RODBC and Rcmdr packages. - If the three packages are loaded in the same R session, the use of RodbcConnect functions cause R to crash. - This crash occur only if Rcmdr is loaded. - If only

[R] Dot plot of character and numeric matrix

2013-01-23 Thread Ng Wee Kiat Jeremy
chart function, I get the error message "'x' must be a numeric vector or matrix", which I can understand it to be a result of the fact that I have characters AA, AG etc as my x-values. Any idea how I can go about doing this? Thanks in advanced! Jeremy [[alternative

Re: [R] Question about Linear Regression

2012-12-28 Thread Jeremy Miles
You can run that as it is. The term to search for on Google is 'dummy coding'. Jeremy On 28 December 2012 07:45, Lorenzo Isella wrote: > > where x3 is a dichotomous variable assuming only 0 and 1 values (x1 and x2 > are continuous variables). > Is there any particular ca

Re: [R] Non-linear regression analysis in R

2012-12-19 Thread Jeremy Miles
Could you provide the code that you're running, so we can see what you're trying to do? Even better would be a repeatable example. Jeremy On 19 December 2012 09:42, Yann Labou wrote: > Hey all, > > I'm trying to fit a non-linear model y ~ a * constant ^ b * x ^ c and &g

[R] Beta-coefficients for ZINB model

2012-12-14 Thread Jeremy Goss
Dear users, Does anyone have any idea how to generate standardised beta coefficients for a ZINB model in R to compare which explanatory variables are having the greatest impact on the dependent variable? Thanks, Jeremy [[alternative HTML version deleted

[R] Marginal effects of ZINB models

2012-12-10 Thread Jeremy Goss
ith R code to compute overall marginal effects of each variable? My model is specified as follows: ZINB <- zeroinfl(Tot.Anglers ~ Location + Season + Daytype + Holiday.not + CPUE + ShoreType + Access + Source.pop + WindSpeed + offset(beat_length), dist="negbin", data=anglers) Man

[R] Help with manipulation of matrix object

2012-12-06 Thread Jeremy Ng
viation: >sd<-apply(sample,1, sd) With both the median and the sd in hand, I want to write the probability of observing the value reported at sample[2,2] I can do this manually, but as the dataframe gets larger and larger, this becomes more time consuming; and furthermore, I wish to wri

Re: [R] Help for a function

2012-12-04 Thread Jeremy Miles
What are you expecting? What do you get? What is the problem? J On 4 December 2012 06:01, anoumou wrote: > Hello all, > I need a help. > I am modeling a disease and a create a R function like that: > > Lambda<-function (x,date1,r,h,a){ > ndate1 <- as.Date(date1, "%d/%m/%Y") > t1 <- as.nume

Re: [R] Replacing string in matrix with zero

2012-11-14 Thread Jeremy Miles
You can use ifelse() #Create data for example x <- matrix(data=c(Inf, 2, 3, 4, Inf, 6, 7, 8, Inf), nrow=3) #Turn Inf into zero. x <- ifelse(x == Inf, 0, x) Jeremy On 14 November 2012 14:13, Nick Duncan wrote: > Dear All, > > I have a matrix in which the diagonal has the str

Re: [R] R and SPSS

2012-11-06 Thread Jeremy Miles
ables - so check that the same variables have been removed. Jeremy On 6 November 2012 13:39, Hui Du wrote: > Hi group: > > > I have a data set, which has severe colinearity problem. While running > linear regression in R and SPSS, I got different models. I am wondering if > som

[R] Searching up a list of values

2012-10-26 Thread Jeremy Ng
1.06653 1.43876 2.15272 0.69042 0.66962 2.02502 0.7646 And this is how file A looks like: 2620456 2830090 2575215 2849041 How do I actually extract and export the corresponding values for A in B? Thanks in advanced! Jeremy [[alternative HTML version deleted

Re: [R] Error: object 'CO2' not found

2012-10-22 Thread Jeremy Miles
You need to load the dataset. First, run data(CO2) Then it should work. Jeremy [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http

[R] loglogistic survreg

2012-09-17 Thread Jeremy Brown
Hi, I'm trying to graph the hazard function using the survreg function with the distributional assumptions to be loglogistic. If h(t)=[lambda*alpha*(lambda*t)^(alpha-1)]/[1+(lambda*t)^alpha], what output from R is alpha? Thanks [[alternative HTML version deleted]]

Re: [R] negative AIC and BIC values in gls

2012-08-22 Thread Jeremy Miles
It's fine. Just interpret them as you would any other (lower is better). On 22 August 2012 16:43, Gary Dong wrote: > Dear R users, > > I obtained negative AIC and BIC and positive Loglik values in a gls model. > Is this normal? how should I interpret them? Thanks! > >AIC BIC

Re: [R] Metafor package: Including multiple (categorical) predictors

2012-08-02 Thread Jeremy Miles
The test of moderator coefficients (QM) is chi-square distributed.You can use the change in this value when you add a predictor to the model as a chi-square test, with df equal to the change in df. Jeremy On 2 August 2012 05:54, Bexkens, Anika wrote: > Dear Metafor users, > > I'd

Re: [R] Package MuMIn (dredge): Error in ret[, ] <- cbind(x, se, rep(if (is.null(df)) NA_real_ else df, : number of items to replace is not a multiple of replacement length.

2012-07-15 Thread Jeremy Little
I have also reinstalled the MuMIn package as suggested at... http://r.789695.n4.nabble.com/Error-message-number-of-items-to-replace-is-not-a-multiple-of-replacement-length-td3257893.html ...however, this made no difference. any help is appreciated. thank you -- View this message in context: h

Re: [R] Package 'MASS' (polr): Error in svd(X) : infinite or missing values in 'x'

2012-07-11 Thread Jeremy Little
Thanks Jessi, your insights are extremely helpful. If you would indulge me one more quick question on your script. You have written... newData<-data.frame(JVeg5=factor(Jdata[,"JVeg5"]),scale(Jdata[,c("Elevation","Lat_Y_pos","Coast_dist","Stream_dist")])) I wish to expand this analysis for all ot

Re: [R] Package 'MASS' (polr): Error in svd(X) : infinite or missing values in 'x'

2012-07-11 Thread Jeremy Little
5550 78250 77000 55650 77000 76800 ... $ Wind_310 : int 10 10 10 10 10 10 10 10 2 10 ... $ TPI: num -122.6 -109 -95.9 -94.7 -76.6 ... $ Landform : int 1 1 1 1 1 1 1 1 1 1 ... Does this provide any insight? Thank you ## Thank you both for your generous time and support, it

[R] Package MuMIn (dredge): Error in ret[, ] <- cbind(x, se, rep(if (is.null(df)) NA_real_ else df, : number of items to replace is not a multiple of replacement length.

2012-07-11 Thread Jeremy Little
of rows of result is not a multiple of vector length (arg 3)". I am unclear what this means and how to resolve the issue. If anyone has any idea how to address this error, I would very much appreciate your response. Thank you in advance. Jeremy My script is as follows : #

Re: [R] Package 'MASS' (polr): Error in svd(X) : infinite or missing values in 'x'

2012-07-09 Thread Jeremy Little
Hi Jessica, thank you for your prompt response. Yes I had deduced it had to do with the Hessian. However, I am not clear what "all columns having range the order of one" actually means and what this means for my data. Does this mean removing decimals (ie by shifting the decimal place)? I would h

[R] Package 'MASS' (polr): Error in svd(X) : infinite or missing values in 'x'

2012-07-09 Thread Jeremy Little
st_dist + Stream_dist, > data=Jdata) > > summary(Global) Error in svd(X) : infinite or missing values in 'x' > ##Try with omit NA command > Global <- polr(JVeg5 ~ Elevation + Lat_Y_pos + Coast_dist + Stream_dist, > data=Jdata, na.action = na.omit, Hess = TRUE) > > s

[R] Installing Rcompression package

2012-01-30 Thread Jeremy MAZET
Dear all I'm trying to install the Rcompression package under R-2.14.0 on a Windows plateform. I need it to use the Ropenoffice package Because there is no binary available, I'm trying to install it from source but I have always some error messages. I have installed zlib and Bzip2 softwares,

[R] Generating repeated network measures in R

2012-01-27 Thread Jeremy Goss
I am working on directed network data of the following form: Origin farm Destination farm Year Farm 1 -> Farm 21999 Farm 1 -> Farm 31999 Farm 3 -> Farm 22000 Farm 1 -> Farm 2

[R] Combining characters

2012-01-04 Thread jeremy
Hi all, I'm trying to combine exhaustively several character arrays in R like: x=c("one","two","three") y=c("yellow","blue","green") z=c("apple","cheese") in order to get concatenation of x[1] y[1] z[1] ("one yellow apple") x[1] y[1] z[2] ("one yellow cheese") x[1] y[2] z[1]("one blue apple")

[R] Creating a sequence from two samples with several constraints (frequency and repeats)

2011-11-04 Thread Jeremy Wang
I'm attempting to create a sequence for an experiment and am hoping I can use R to create it. It has several constraints: (1) It is made up of two sequences (red and green) that have 4 different repeating triplets (e.g. T1=ABC T2=DEF T3=GHI JKL) (2) Each sequence has the following constraints: (a)

Re: [R] help in interpreting paired t-test

2011-09-21 Thread Jeremy Miles
> cor(A, B) [1] 0.9986861 The data are very, very highly correlated. The higher the correlation, the greater the power of the t-test to detect the same difference between the means. Jeremy On 20 September 2011 10:46, Pedro Mardones wrote: > Dear all; > > A very basic question

Re: [R] Differences in SAS and R defaults

2011-08-29 Thread Jeremy Miles
Do you mean things like treatment of categorical variables in regression procedures (which have different defaults in different procedures in SAS), and different default as to the reference category in logistic regression? Jeremy On 29 August 2011 04:46, n wrote: > Hello all, >

Re: [R] questions about "metafor" package

2011-08-17 Thread Jeremy Miles
ximate) the pooled SD? jeremy __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Re: [R] Automatic creation of binary logistic models

2011-08-04 Thread Jeremy Miles
Sounds like you want a best subsets regression, the bestglm() function, found in the bestglm() package will do the trick. Jeremy On 4 August 2011 12:23, Paul Smith wrote: > Dear All, > > Suppose that you are trying to create a binary logistic model by > trying different com

Re: [R] How to search for R related topics in search engines?

2011-07-27 Thread Jeremy Miles
Use rseek.org. Jeremy On 27 July 2011 07:12, Paul Menzel wrote: > Dear R folks, > > > I am having problems getting good results when searching for R related > topics, that means I have not found out yet what keywords I should use > to get only relevant results. Most of t

Re: [R] Message for R-help mailing list

2011-07-26 Thread Jeremy Miles
This is clearly a message for the R-help mailing list, since it was sent to the R help mailing list. fisher.test(x)[1] Jeremy On 26 July 2011 14:51, Zmarz, Pawel wrote: > Dear r-helpers, > > I would be very grateful if you could post the message below on the r-help > disc

Re: [R] function lm, get back the coefficient

2011-07-26 Thread Jeremy Miles
Will: result$coef[[2]] Give you want you want? Jeremy On 26 July 2011 08:21, ascoquel wrote: > Hi, > > I've done a linear fit on my data and I would like to get back the a (time) > coefficient ... > > mod<-lm(res_sql2$Lx0x~0+time) > result<-data.frame() >

Re: [R] Extract elements from objects in a list

2011-06-28 Thread Jeremy Miles
.5209 0.5635 0.4789 0.5428 0.5372 0.5403 0.5086 0.5470 0.4219 0.4758 > 0.4824 0.5165 0.5035 0.4833 0.4754 0.5227 > Median Median Median Median > 0.6169 0.4904 0.4773 0.4779 > > On Tue, Jun 28, 2011 at 7:22 PM, Jeremy Miles wrote: >> Hi All, >> >> I want to extract elem

[R] Extract elements from objects in a list

2011-06-28 Thread Jeremy Miles
vector. This would be: x[[1]][[3]] x[[2]][[3]] x[[3]][[3]] I thought there would be a way of doing this with something like apply(), but I cannot work it out. Is there a way of doing this without a loop? Thanks, Jeremy __ R-help@r-project.org mail

Re: [R] Factor Analysis with orthogonal and oblique rotation

2011-06-22 Thread Jeremy Miles
unction in the psych package has more flavors of extraction and rotation. Jeremy On 22 June 2011 14:02, Rosario Garcia Gil wrote: > Hello > I seem to find only two types of rotation for the factanal function in R, the > Varimax and Promax, but is it possible to run a orthogonal and ob

Re: [R] Bartlett's Test of Sphericity

2011-06-17 Thread Jeremy Miles
cortest.bartlett() in the psych package. I've never seen a non-significant Bartlett's test. Jeremy On 17 June 2011 12:43, thibault grava wrote: > Hello Dear R user, > > I want to conduct a Principal components analysis and I need to run two > tests to check whether

[R] Matching vector order by indicators in a matrix

2011-06-16 Thread Jeremy Beaulieu
ve some pretty hacky solutions, but I wanted to see if there was an easy way to do this that I am completely missing. Thanks and all the best, Jeremy __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] BIZARRE results from wilcox.test()

2011-06-14 Thread Jeremy Miles
The results weren't BIZARRE (or even bizarre). You didn't understand them, but that doesn't make them bizarre. (I didn't understand them either, but thanks to the replies, now I do). Why not send something more similar to your dataset to ensure you get relevant answers ?

Re: [R] Results of CFA with Lavaan

2011-06-08 Thread Jeremy Miles
What do you mean by latent estimate? The table of variances has variances for each factors. Is there something different in the sem output that you don't see here? Yes, this looks normal. Jeremy On 8 June 2011 13:14, R Help wrote: > I've just found the lavaan package,

Re: [R] best subset regression in R

2011-05-04 Thread Jeremy Miles
ion+R , and sends me to this page: http://www.statmethods.net/stats/regression.html Jeremy -- Jeremy Miles Support Dan and Alex's school: Vote for Goethe Charter School to receive a grant from Pepsi to help build a library: http://www.refreshe

Re: [R] fisher exact for > 2x2 table

2011-04-29 Thread Jeremy Miles
x27;s exact test was extended to general R×C tables by Freeman and Halton (1951), and this test is *also* known as the Freeman-Halton test." Emphasis mine. Jeremy -- Jeremy Miles Psychology Research Methods Wiki: www.researchmethodsinpsychology.com __

Re: [R] Speed up code with for() loop

2011-04-28 Thread Jeremy Hetzel
ndles set.seed() randomization all.equal(Delta_ln, Delta_ln3) time.one time.two time.three as.numeric(time.three) / as.numeric(time.one) Combining parallel() with the .Internal calls reduces the elapsed time by about 70% on Ubuntu Natty. Multicore is not available for Win

Re: [R] R forum for only Statistics

2011-04-28 Thread Jeremy Hetzel
n Google Groups ( https://groups.google.com/forum/#!forumsearch/sci.stat.*). Perhaps others have a better feel for which forums are of higher quality. The sci.stat.* groups look a bit overrun with spam these days. Jeremy On Thursday, April 28, 2011 7:26:06 AM UTC-4, Vincy Pyne wrote: > > Hi!

Re: [R] setting options only inside functions

2011-04-27 Thread Jeremy Hetzel
See ?on.exit Jeremy On Wednesday, April 27, 2011 9:16:13 AM UTC-4, Jannis wrote: > > Dear list members, > > > is it possible to set some options only inside a function so that the > original options are restored once the function is finished or aborted due > to an e

Re: [R] calculations with vectors of unequal length

2011-04-27 Thread Jeremy Hetzel
See ?merge. df.1 <- data.frame(year=factor(rep(1:3,3)), level=rep(letters[1:3],3), number=c(11:19)) df.2 <- data.frame(year=factor(c(1:5)), number=c(21:25)) df.3 <- merge(df.1, df.2, by = "year") df.3$new <- with(df.3, number.x + number.y) Jeremy On Wednesday, April 2

Re: [R] Rcmdr vs SPSS in hungarian

2011-04-21 Thread Jeremy Miles
should use the studentized (which SPSS calls studentized-deleted). Jeremy 2011/4/21 Tamas Barjak : > Remélem valaki ezt is elolvassa, megérti, és válaszol a problémámra. > > A gondom a következő: > > Kiszámoltattam a maradékokat az R commanderrel, és az SPSS -el is. És itt >

Re: [R] Rcmdr vs SPSS

2011-04-20 Thread Jeremy Miles
tudentized residuals (because they follow the distribution). John Fox's regression book <http://socserv.mcmaster.ca/jfox/Books/Companion/> explains all of this nicely. Jeremy On 20 April 2011 14:36, Tamas Barjak wrote: > Hy all! > > Excuse me for the inaccurate composition, but

Re: [R] Random Relabelling

2011-04-20 Thread Jeremy Hetzel
Kevin, The following follows John's suggestion, but without the loop. It's quick for me. Jeremy Jeremy T. Hetzel Boston University ## Generate sample data n <- 4000 rep <- 1000 rate <- rnorm(n, mean = 15, sd = 2) / 10 # Mortality rates around 15/100k ## Create a

Re: [R] Monte Carlo Simulation

2011-04-15 Thread Jeremy Miles
to know about write.table() for the saving the files, or is the problem with splitting a large file, or generating the 1000 names ... Jeremy -- Jeremy Miles Psychology Research Methods Wiki: www.researchmethodsinpsychology.com __ R-help@r-project.o

Re: [R] R plots pdf() does not allow spotcolors?

2011-04-13 Thread Jeremy Hetzel
e PDF, convert to spot color in Scribus, then break the PDF apart again for Latex. Jeremy __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and pr

Re: [R] R plots pdf() does not allow spotcolors?

2011-04-13 Thread Jeremy Hetzel
Scribus claims to be able to convert RGB/CMYK colors to spot colors: http://documentation.scribus.net/index.php/Spot_Colors I've never used Scribus, but it's floss. Jeremy __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/

Re: [R] Converting a categorical variable to multiple dichotemousvariables

2011-04-12 Thread Jeremy Hetzel
imtest$eth, unique(simtest$eth), "==") + 0 # Combine simtest.combined <- cbind(simtest, simtest.dichotomous) head(simtest.combined) Jeremy Jeremy Hetzel Boston University __ R-help@r-project.org mailing list https://stat.ethz.ch/mail

Re: [R] Multinomial Logit Model with lots of Dummy Variables

2011-04-10 Thread Jeremy Hetzel
rn(A.value) }) B <- apply(dat, 1, function(x) { B <- x[7:11] B.names <- names(x[7:11]) B.names B.value <- B.names[B==1] return(B.value) }) # Combine into new data frame dat.new <- data.frame(dat$outcome, A, B) head(dat.new) Jeremy __ R-help

Re: [R] Removing not duplicated rows

2011-04-08 Thread Jeremy Hetzel
Sorry, I left out the names() function in the last step. Try this instead: x <- data.frame(cbind(id=c(1,2,2,2,3,3,4,5,6,6), value=1:10)) id.table <- table(x$id) x_new <- subset(x, id %in% names(id.table[id.table > 1])) Jeremy __ R-help@r

Re: [R] Removing not duplicated rows

2011-04-08 Thread Jeremy Hetzel
As I understand it, you are trying to subset the data frame to include only rows with a non-unique id. Try this: x <- data.frame(cbind(id=c(1,2,2,2,3,3,4,5,6,6), value=1:10)) id.table <- table(x$id) x_new <- subset(x, id %in% id.table[id.table >

Re: [R] xyplot, groups and colors

2011-04-08 Thread Jeremy Hetzel
= circumference, group=Tree)) # Specify the geom_point and geom_line colour aesthetics as group g1 + geom_point(aes(colour = group)) + geom_line(aes(colour = group)) Is this what you are after? Jeremy Jeremy Hetzel Boston University [[alternative HTML version deleted]]

Re: [R] Correlation Matrix

2011-04-07 Thread Jeremy Miles
omething I > have to construct manually? > You can use cbind(). cor(cbind(MyDataFrame$variable1, MyDataFrame$variable2,MyDataFrame$variable3) ) Jeremy __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do re

Re: [R] Structural equation modeling in R(lavaan,sem)

2011-04-03 Thread Jeremy Miles
mnet. You can join it here: http://www2.gsu.edu/~mkteer/semnet.html#Joining. Jeremy -- Jeremy Miles Psychology Research Methods Wiki: www.researchmethodsinpsychology.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo

Re: [R] Italicized title from index

2011-03-31 Thread Jeremy Newman
Hi, Thank you *very* much. I'll remember that in the future! Cheers, -Jeremy N Undergraduate Researcher in Macroecology University of Ottawa Department of Biology Ad astra per alia porci! On Thu, Mar 31, 2011 at 8:01 AM, Henrique Dallazuanna wrote: > Better: > > plot(1,

[R] Italicized title from index

2011-03-30 Thread Jeremy Newman
c(.(spp)))* I get: "*Yield for 1*" While *spp=Gadus morhua* I'm at wit's end, I tried to read about substitute, expression, and eval functions in the hopes I can figure it out, but I am lost! Thanks for any help! Cheers, -Jeremy N Undergraduate Researcher in Macroecology U

Re: [R] Structural equation modeling in R(lavaan,sem)

2011-03-29 Thread Jeremy Miles
which will help. http://www.biomedcentral.com/1756-0500/3/267 Might I also suggest you take a look at the semnet list, which is populated by practitioners of SEM. Jeremy On 29 March 2011 12:25, jouba wrote: > Dear all, > There is some where documentation to understand all  indices in

Re: [R] Structural equation modeling in R(lavaan,sem)

2011-03-28 Thread Jeremy Miles
4,NA > x7 <->x7 ,sigmma5,NA > x6 <->x6 ,sigmma6,NA > > It's a somewhat unusual looking model. What are you trying to do? Jeremy -- Jeremy Miles Psychology Research Methods Wiki: www.researchmethodsinpsychology.com [[alternative HTML version deleted]]

Re: [R] Structural equation modeling in R(lavaan,sem)

2011-03-27 Thread Jeremy Miles
Again, I should reiterate that you have a hard road in front of you, and it will be made much easier if you read a couple of introductory SEM texts, which will answer this sort of question. Jeremy -- Jeremy Miles Psychology Research Methods Wiki: www.researchmethodsinpsychology.com

Re: [R] testing power of correlation

2011-03-05 Thread Jeremy Miles
Can you clarify what you mean? The strength of the correlation is the correlation. One (somewhat) useful definition is Cohen's, who said 0.1 is small, 0.3 is medium and 0.5 is large. Or do you (as your subject says) want to get the power for a correlation? This is a different thing. J

[R] building R from source

2011-02-17 Thread Jeremy MAZET
Dear all, I post again my question with a new title ... please, help me! I build a customized version of R-2.12.1 from source (under windows XP). I work as explain in the R Installation and Adminstration manual and all seems to be good... But When I try to uninstall this version I have the err

[R] uninstall R

2011-02-16 Thread Jeremy MAZET
Dear all, I build a customized version of R-2.12.1 from source (under windows XP). I work as explain in the R Installation and Adminstration manual and all seems to be good... But When I try to uninstall this version I have the error message "cannot find utCompiledCode record for this version o

Re: [R] sem problem - did not converge

2011-02-14 Thread Jeremy Miles
oining the structural equation modeling list - semnet. This isn't really a sem (the package) or R problem, it's a more general SEM (the approach) problem. Jeremy Chen, F., Bollen, K., Paxton, P., Curran, P.J., & Kirby, J. (2001). Improper solutions in structural equation models: C

Re: [R] Revolution Analytics reading SAS datasets

2011-02-10 Thread Jeremy Miles
guess if they release it as open source, that could be construed as publishing the algorithm. (SPSS and WPS both can open SAS files, and I'd be surprised if SAS licensed to them. [Esp WPS, who SAS are (or were) suing for all kinds of things in court in London.) Jeremy __

[R] Generate data from correlation matrix

2011-02-07 Thread Jeremy Miles
Hi All, I was wondering if anyone knew of a function which would generate data from a pre-specified correlation matrix (as in the Stata command r2corr) or sampled from a population with a specific covariance/correlation. (I thought I'd check before I wrote something inelegant and slow.) J

Re: [R] HLM Model

2011-01-27 Thread Jeremy Miles
been lost. However, it appears that in R you did not dummy code them. It also appears you haven't given use all of the SAS output. Jeremy On 27 January 2011 15:52, Belle wrote: > > Hi Harold: > > I know the outputs are different between SAS and R, but the results that I > got ha

[R] Merge() error

2010-12-13 Thread Jeremy Miles
frames does not bt <- merge( bt, np, by=("caseid"), all=TRUE) # Changed from np, bt to bt,np. The code always worked fine before, until someone 'helpfully' duplicated some of the variables across the data frames, so in addition to caseid, each also contains Autho

[R] R crash

2010-11-15 Thread Jeremy MAZET
We distribute several R applications using the tcltk package on different servers or PC (Windows XP). On some machines and in a not reproducible way, all the R windows disappear when using functions like tkgetSaveFile or tkchooseDirectory. The R application remains open (the Rgui.exe processus

Re: [R] how do I make a correlation matrix positive definite?

2010-10-21 Thread Jeremy Miles
omeone who has not misunderstood. :) Jeremy On 21 October 2010 16:14, HAKAN DEMIRTAS wrote: > > I know. > > Let me re-phrase the question: How do I convert a non-positive definite > correlation matrix to a positive-definite correlation matrix in R? I don't > think cov2cor i

Re: [R] how do I make a correlation matrix positive definite?

2010-10-21 Thread Jeremy Miles
You could use cov2cor() to convert from covariance matrix to correlation matrix. If the correlation is >1, the matrix won't be positive definite, so you can restandardize the matrix to get a pos def correlation matrix. Jeremy On 21 October 2010 15:50, HAKAN DEMIRTAS wrote: > H

[R] overlaying multiple contour plots

2010-10-13 Thread Jeremy Olson
element occupies on this map. Is there a way to do this in 'R'? I am fairly new to this software, so any help would be much appreciated. Thank you in advance, Jeremy [[alternative HTML version deleted]] __ R-help@r-project.org mailing

Re: [R] FDR

2010-10-07 Thread Jeremy Miles
This is correct. Wikipedia is not bad, and provides some references. Another web page: http://courses.ttu.edu/isqs6348-westfall/images/6348/BonHolmBenHoch.htm <http://courses.ttu.edu/isqs6348-westfall/images/6348/BonHolmBenHoch.htm> Jeremy On 7 October 2010 10:37, wrote: > Dea

  1   2   >