Re: [R] Finding the package providing funtion "%du%"

2021-06-30 Thread Federico Calboli
in public on the r-help list! F > > > > On Wed, Jun 30, 2021 at 1:03 PM Federico Calboli > wrote: > Hello All, > > I am playing with igraph (which seems to work for what I have used it). > Nevetheless: > > demo('community',

[R] Finding the package providing funtion "%du%"

2021-06-30 Thread Federico Calboli
_0.3.8 generics_0.1.0 [10] ellipsis_0.3.2 tools_4.1.0 glue_1.4.2 purrr_0.3.4 compiler_4.1.0 pkgconfig_2.0.3 tidyselect_1.1.1 tibble_3.1.2 -- Federico Calboli LBEG - Laboratory of Biodiversity and Evolutionary Genomics Charles Deberiotstraat 32 box

[R] install_github does not work locally

2021-04-13 Thread Federico Calboli
purrr_0.3.4 callr_3.6.0 fs_1.5.0 ps_1.6.0 curl_4.3 testthat_3.0.2 [25] memoise_2.0.0 glue_1.4.2cachem_1.0.4 compiler_4.0.4 desc_1.3.0prettyunits_1.1.1 -- Federico Calboli LBEG - Laboratory of Biodiversity and Evolutionary Gen

[R] how to feed lme() and lmer() data for a loop

2020-02-25 Thread Federico Calboli
by building data frames on the fly, but this is cumbresome, both as code and very likely as performance, especially looping over lots of data having to generate these dummy data frames. If there is a trick I am missing I’d be grateful if anybody could set me straight. Best F -- Federico Calboli LBEG

Re: [R] keeping github packages up to date

2018-10-13 Thread Federico Calboli
ls. Cheers F > > On October 12, 2018 8:00:11 AM PDT, Federico Calboli > wrote: >> Hi all, >> >> more and more people (sadly) are putting stuff on github, with either >> no CRAN upload or an package. So I am stuck with using devtools and >> ins

[R] keeping github packages up to date

2018-10-12 Thread Federico Calboli
Hi all, more and more people (sadly) are putting stuff on github, with either no CRAN upload or an package. So I am stuck with using devtools and install_github. I know how to keep stuff from CRAN updated — how do I do the same for github stuff? Cheers F -- Federico Calboli LBEG

[R] getting 21 very different colours

2018-09-11 Thread Federico Calboli
colourchart, but the visual differences between ’skyblue’ and ’slategrey’ elude me when plotted as dots on a plot). Cheers F -- Federico Calboli LBEG - Laboratory of Biodiversity and Evolutionary Genomics Charles Deberiotstraat 32 box 2439 3000 Leuven +32 16 32 87 67

[R] valid package repositories

2017-10-02 Thread Federico Calboli
that might be useful but I need to sort out. I am looking at formal claims ‘we have developed a method to do X and said method is available to the public as a R library’. If that is the claim I expect it to be true. Best F -- Federico Calboli LBEG - Laboratory of Biodiversity

Re: [R] replicating PLINK's --genome calculations.

2016-10-06 Thread Federico Calboli
seems to do what I need. Best F > > Cheers, > Bert > > > Bert Gunter > > "The trouble with having an open mind is that people keep coming along > and sticking things into it." > -- Opus (aka Berkeley Breathed in his "Bloom County" co

[R] replicating PLINK's --genome calculations.

2016-10-06 Thread Federico Calboli
PLINK does, but I’d rather not reinvent the wheel so it might be worth asking: is there any package/function that would do (in R) what PLINK does with --genome? Bets wishes F -- Federico Calboli Ecological Genetics Research Unit Department of Biosciences PO Box 65 (Biocenter 3, Viikinkaari 1

[R] why is 9 after 10?

2016-02-12 Thread Federico Calboli
this incredibly silly behaviour so that my table follows a reasonable expectation that 9 comes before 10 (and so on and so forth)? BW F -- Federico Calboli Ecological Genetics Research Unit Department of Biosciences PO Box 65 (Biocenter 3, Viikinkaari 1) FIN-00014 University of Helsinki Finland

Re: [R] why is 9 after 10?

2016-02-12 Thread Federico Calboli
cserv.mcmaster.ca/jfox > > > > >> -Original Message- >> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Federico >> Calboli >> Sent: February 12, 2016 10:13 AM >> To: R Help <r-help@r-project.org> >> Subject: [R] why

Re: [R] testing whether two character vectors contain (the same) items in the same order

2015-08-07 Thread Federico Calboli
that distCayley() in Rankcluster does what you want. From the examples: x=1:5 y=c(2,3,1,4,5) distCayley(x,y) 8 Cheers, Boris On Aug 6, 2015, at 9:51 AM, Federico Calboli federico.calb...@helsinki.fi wrote: On 6 Aug 2015, at 15:40, Bert Gunter bgunter.4...@gmail.com wrote

[R] testing whether two character vectors contain (the same) items in the same order

2015-08-06 Thread Federico Calboli
in numbers and use a rank test, but I was left wondering whether this is the only solution and whether there are more appropriate solutions that are already implemented in R (I am not going to reinvent the wheel if I can avoid it). BW F -- Federico Calboli Ecological Genetics Research Unit

Re: [R] testing whether two character vectors contain (the same) items in the same order

2015-08-06 Thread Federico Calboli
On Thursday, August 6, 2015, Federico Calboli federico.calb...@helsinki.fi wrote: Hi All, let’s assume I have a vector of letters drawn only once from the alphabet: x = sample(letters, 15, replace = F) x [1] z t g l u d w x a q k j f n “v y = x[c(1:7,9:8, 10:12, 14, 15, 13)] I would

Re: [R] what constitutes a 'complete sentence'?

2015-07-07 Thread Federico Calboli
-- Federico Calboli Ecological Genetics Research Unit Department of Biosciences PO Box 65 (Biocenter 3, Viikinkaari 1) FIN-00014 University of Helsinki Finland federico.calb...@helsinki.fi __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https

Re: [R] what constitutes a 'complete sentence'?

2015-07-03 Thread Federico Calboli
, Federico Calboli federico.calb...@helsinki.fi wrote: On 3 Jul 2015, at 12:14, Hadley Wickham h.wick...@gmail.com wrote: It might be a line break problem - I think you want: Description: Functions designed to test for single gene/phenotype association and for pleiotropy on genetic

Re: [R] what constitutes a 'complete sentence'?

2015-07-03 Thread Federico Calboli
not help. BW F Hadley On Fri, Jul 3, 2015 at 10:09 AM, Federico Calboli federico.calb...@helsinki.fi wrote: Hi All, I am upgrading a package for CRAN, and I get this note: checking DESCRIPTION meta-information ... NOTE Malformed Description field: should contain one or more

Re: [R] what constitutes a 'complete sentence'?

2015-07-03 Thread Federico Calboli
. Cheers Petr -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Hadley Wickham Sent: Friday, July 03, 2015 1:14 PM To: Federico Calboli Cc: R-help Subject: Re: [R] what constitutes a 'complete sentence'? In that case, you need to create

[R] what constitutes a 'complete sentence'?

2015-07-03 Thread Federico Calboli
that check? Best F -- Federico Calboli Ecological Genetics Research Unit Department of Biosciences PO Box 65 (Biocenter 3, Viikinkaari 1) FIN-00014 University of Helsinki Finland federico.calb...@helsinki.fi __ R-help@r-project.org mailing list

Re: [R] ordinary kriging: the edges of the polygons are ignored

2014-08-21 Thread Federico Calboli
(heat.colors(100))) # Your result is in the var1.pred-variable of res$krige_output You will generally get more and quicker answers to questions about spatial data and methods from the r-sig-geo list. Best wishes, Jon On 8/20/2014 11:01 PM, Federico Calboli wrote: Hi All, I am trying

[R] ordinary kriging: the edges of the polygons are ignored

2014-08-20 Thread Federico Calboli
Hi All, I am trying to do some kriging of a floor, based on a number of heat sensors. My data looks like this: sensortempxy 1 1 1.25437406 390 2960 2 2 0.64384594 830 2960 3 3 1.52067733 1420 2960 4 4 1.21441928 3127 2920 5 5 1.04227694

[R] vcf, plink and other files in the /demo of a package

2013-12-02 Thread Federico Calboli
Hi All, together with colleagues we are planning to submit a 2.0 version of a package we have on CRAN. Because the package deals with high throughput genomic data we though it would be nice to have some sort of guidance for the users. This should ideally mean a 'vignette', but as the time of

[R] repeating values in an index two by two

2013-11-11 Thread Federico Calboli
Hi All, I am trying to create an index that returns something like 1,2,1,2,3,4,3,4,5,6,5,6,7,8,7,8 and so on and so forth until a predetermined value (which is obviously even). I am trying very hard to avoid for loops or for loops front ends. I'd be obliged if anybody could offer a

Re: [R] repeating values in an index two by two

2013-11-11 Thread Federico Calboli
, andrija djurovic djandr...@gmail.com wrote: Hi. Here are two approaches: c(mapply(function(x,y) rep(c(x,y), 2), (1:10)[c(T,F)], (1:10)[c(F,T)])) c(tapply(1:10, rep(1:(10/2), each=2), rep, 2), recursive=T) Andrija On Mon, Nov 11, 2013 at 1:11 PM, Federico Calboli f.calb

[R] R vs octave development strategy (and success)

2013-10-29 Thread Federico Calboli
Hi All, if memory serves me well I recall some paper comparing the relative success in getting mainstream acceptance (as mainstream as statistics can be) of both R and Octave. I remember vaguely that the fact the development strategies (core team vs one main developer) played a major role in

[R] How many samples ACTUALLY used in regression?

2013-03-18 Thread Federico Calboli
Dear All, is there a simple way that covers all regression models to extract the number of samples from a data frame/matrix actually used in a regression model? For instance I might have a data of 100 rows and 4 colums (1 response + 3 explanatory variables). If 3 samples have one or more NAs

Re: [R] How many samples ACTUALLY used in regression?

2013-03-18 Thread Federico Calboli
On Mon, Mar 18, 2013 at 8:39 AM, Marc Schwartz marc_schwa...@me.com wrote: On Mar 18, 2013, at 7:36 AM, Federico Calboli f.calb...@imperial.ac.uk wrote: Dear All, is there a simple way that covers all regression models to extract the number of samples from a data frame/matrix actually

[R] checker/chequer board pattern as a colour

2013-01-07 Thread Federico Calboli
Hi All, is there a reasonably simple way of using a black and white chequer/checker board pattern as a colour: barplot(mydata, col = c('red', 'blue' 'checkerboard')) ? BW F -- Federico C. F. Calboli Neuroepidemiology and Ageing Research Imperial College, St. Mary's Campus Norfolk Place,

Re: [R] checker/chequer board pattern as a colour

2013-01-07 Thread Federico Calboli
something like this, too many patterned areas in a plot can be more distracting and distorting than useful. thanks, but that sounds way too much hassle than it's worth BW F On Mon, Jan 7, 2013 at 8:00 AM, Federico Calboli f.calb...@imperial.ac.uk wrote: Hi All, is there a reasonably

[R] hidden for() loop subsetting a matrix?

2012-08-15 Thread Federico Calboli
Hi, I am subsetting a matrix thus: test [,1] [,2] [,3] [1,]17 13 [2,]28 14 [3,]39 15 [4,]4 10 16 [5,]5 11 17 [6,]6 12 18 test[cbind(c(1,3,5), c(2,1,3))] [1] 7 3 17 This works fine, and is the equivalent of c(test[1,2], test[3,1],

[R] rtags for VI(M)

2012-03-09 Thread Federico Calboli
Hi, according to the help file rtags does not support VI(M) yet. Is there any known hack to ctags to get tags for R in VI(M)? BW F -- Federico C. F. Calboli Neuroepidemiology and Ageing Research Imperial College, St. Mary's Campus Norfolk Place, London W2 1PG Tel +44 (0)20 75941602 Fax

[R] closing file with close(file) *silently*

2012-03-06 Thread Federico Calboli
Hi All, I am writing a function that reads a file in myfile = file('myfile.raw', 'rb') . . . . . close(myfile) No matter what, I get the warning Warning message: closing unused connection 3 (myfile.raw) Since the whole thing is in a function, I'd like to avoid unecessary noise for the user,

Re: [R] closing file with close(file) *silently*

2012-03-06 Thread Federico Calboli
On 6 Mar 2012, at 18:01, Sarah Goslee wrote: The help for warning offers some suggestions. none that seem to work though. F Sarah On Tue, Mar 6, 2012 at 12:53 PM, Federico Calboli f.calb...@imperial.ac.uk wrote: Hi All, I am writing a function that reads a file in myfile

[R] [R-pkgs] MultiPhen 0.3 is available on CRAN

2012-03-03 Thread Federico Calboli
Dear All, a new version of MultiPhen (0.3) is available on CRAN, and will be available to a mirror near you soon. *Please upgrade* because this release is a bug fix release. A new version, with improvements in the output and more useful error messages is basically ready, but I will wait to

[R] Schoenfeld residuals for a null model coxph

2012-02-23 Thread Federico Calboli
Hi, I have a coxph model like coxph(Surv(start, stop, censor) ~ x + y, mydata) I would like to calculate the Schoenfeld residuals for the null, i.e the same model where the beta hat vector (in practical terms, the coeff vector spat out by summary()) is constrained to be all 0s --all lese

Re: [R] variance explained in a cox ph model

2012-02-22 Thread Federico Calboli
On 22 Feb 2012, at 14:01, Terry Therneau wrote: --- begin included message --- I have a left truncated, right censored cox model: coxph(Surv(start, stop, censor) ~ x + y, mydata) I would like to know how much of the observed variance (as a number between 0 and 1) is explained by each

[R] variance explained in a cox ph model

2012-02-21 Thread Federico Calboli
Hi All, I have a left truncated, right censored cox model: coxph(Surv(start, stop, censor) ~ x + y, mydata) I would like to know how much of the observed variance (as a number between 0 and 1) is explained by each variable. How could I do that? Adding terms sequentially and then using

[R] logical subsetting, indexes and NAs

2012-01-28 Thread Federico Calboli
Dear All, just a quick example: x = 1:25 x[12] = NA x [1] 1 2 3 4 5 6 7 8 9 10 11 NA 13 14 15 16 17 18 19 20 21 22 23 24 25 y = x[x10] y [1] 1 2 3 4 5 6 7 8 9 NA Is there any way of NOT getting NA for y = x[x10]? Similarly y = x[x15] y [1] 1 2 3 4 5 6 7

[R] cat, and printing the last separator

2012-01-25 Thread Federico Calboli
Hi All, I have the following command: cat(rbind(table(gen$sex, gen$ddn2)[1,],round(table(gen$sex, gen$ddn2)[1,]/apply(table(gen$sex, gen$ddn2),2,sum) * 100)), sep = c(' (','%)\n'), file = '') 3 (20%) 17 (30%) 15 (31 i.e. it does NOT print the last separator, which is something that bugs me a

Re: [R] cat, and printing the last separator

2012-01-25 Thread Federico Calboli
On 25 Jan 2012, at 11:54, Duncan Murdoch wrote: I think the documentation for cat is a little ambiguous, but it is working as documented if I read If any element of sep contains a newline character, to mean that the element consists of a newline and nothing else. I'm not sure if that was

[R] barplot ignoring col parameter

2011-12-05 Thread Federico Calboli
Hi All, I'm having a problem with barplot: mydata [1,] 2 108 0 0 0 1 3 0 0 0 0 0 7 18 3 4 8 20 26 20 19 7 1 1 mycol = c(rep('yellow', 2), rep('white', 3), rep('orange',2), rep('white', 5), rep('orange',3), rep('red',9)) barplot(mydata, col = mycol) gives me an uniformly

Re: [R] barplot ignoring col parameter

2011-12-05 Thread Federico Calboli
, using the 'x' object as you created the code works, and I can have a workaround. I fail to see why it would not work using mydata. Cheers F Michael On Mon, Dec 5, 2011 at 10:44 AM, Federico Calboli f.calb...@imperial.ac.uk wrote: Hi All, I'm having a problem with barplot: mydata

[R] fitting some form of linear model with bimodal distribution of dependent variable

2011-11-25 Thread Federico Calboli
Hi All, I have a parameter that is bimodal, and I want to get some sort of linear model done with it results = some.linear.function(bimodal.param ~ factor1 + some other stuff, mydata) I want to see if factor 1 matters (it has 3 levels, of of which can be taken as baseline), i.e:

[R] strsplit and forward slash '/'

2011-08-03 Thread Federico Calboli
Hi All, is there a way of using strsplit with a forward slash '/' as the splitting point? For data such as: 1 T/TC/C 16/33 2 T/TC/C 33/36 3 T/TC/C 16/34 4 T/TC/C 16/31 5 C/CC/C 28/29 6 T/TC/C 16/34 strsplit(my.data[1,1], /) # and any

Re: [R] strsplit and forward slash '/'

2011-08-03 Thread Federico Calboli
On 3 Aug 2011, at 17:41, Duncan Murdoch wrote: It looks as though your my.data[1,1] value is a factor, not a character value. strsplit(as.character(my.data[1,1]), /) Thanks Duncan, this solved it. Best Federico would work, or you could avoid getting factors in the first place,

Re: [R] strsplit and forward slash '/'

2011-08-03 Thread Federico Calboli
strsplit(as.character(my.data[1,1]), /) work? yes! Thanks Federico If you used read.table() to get your data in, you might want the as.is=TRUE or the stringsAsFactors=FALSE argument. Sarah On Wed, Aug 3, 2011 at 12:37 PM, Federico Calboli f.calb...@imperial.ac.uk wrote: Hi All

[R] applying function to multiple columns of a matrix

2011-07-12 Thread Federico Calboli
Hi, I want to apply a function to a matrix, taking the columns 3 by 3. I could use a for loop: for(i in 1:3){ # here I assume my data matrix has 9 columns j = i*3 set = my.data[,c(j-2,j-1,j)] my.function(set) } which looks cumbersome and possibly slow. I was hoping there is some function in

Re: [R] RES: applying function to multiple columns of a matrix

2011-07-12 Thread Federico Calboli
- De: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Em nome de Federico Calboli Enviada em: terça-feira, 12 de julho de 2011 10:07 Para: r-help Assunto: [R] applying function to multiple columns of a matrix Hi, I want to apply a function to a matrix, taking

[R] Making a new package: licence

2011-07-08 Thread Federico Calboli
HI All, I have written and succesfully uploaded a new package. The licence it is under is 'GPL' --no version. My assumption is, since all the code is written in R the licence R used for R would affect the code (hence my GPL stands for whatever version of the GPL R is under) I am happy with

Re: [R] Making a new package: licence

2011-07-08 Thread Federico Calboli
On 8 Jul 2011, at 12:06, Duncan Murdoch wrote: On 11-07-08 6:20 AM, Federico Calboli wrote: HI All, I have written and succesfully uploaded a new package. The licence it is under is 'GPL' --no version. My assumption is, since all the code is written in R the licence R used for R would

Re: [R] Making a new package: licence

2011-07-08 Thread Federico Calboli
On 8 Jul 2011, at 15:56, Spencer Graves wrote: Ok, thanks for that. I though that, since R in under GPL-v2, I can only release my code under GPL-v2 because the code is written in R and probably qualifies as a derivative work. Did you include someone else's GPL-vx code (possibly

Re: [R] Making a new package: licence

2011-07-08 Thread Federico Calboli
On 8 Jul 2011, at 16:12, Barry Rowlingson wrote: On Fri, Jul 8, 2011 at 4:07 PM, Federico Calboli f.calb...@imperial.ac.uk wrote: On 8 Jul 2011, at 15:56, Spencer Graves wrote: Ok, thanks for that. I though that, since R in under GPL-v2, I can only release my code under GPL-v2 because

[R] Surv(): Stop time must be start time, NA created

2011-06-03 Thread Federico Calboli
I am writing to get a better handle on a warning I am getting from a coxph analysis I am doing. I am analysing age of onset of dementia *after* the onset of parkinson disease. My data looks like: age.park age.dem age.death censor x1 x2 x3 x4 1 76 8788 0 16 33 E3

Re: [R] Surv(): Stop time must be start time, NA created

2011-06-03 Thread Federico Calboli
it helps. Best, Dimitris On 6/3/2011 12:17 PM, Federico Calboli wrote: I am writing to get a better handle on a warning I am getting from a coxph analysis I am doing. I am analysing age of onset of dementia *after* the onset of parkinson disease. My data looks like: age.park

[R] where are my pspline knots?

2010-11-17 Thread Federico Calboli
Hi All, I am trying to figure out how to get the position of the knots in a pspline used in a cox model. my.model = coxph(Surv(agein, ageout, status) ~ pspline(x), mydata) # x being continuous How do I find out where the knot of the spline are? I would like to know to figure out how many

[R] rounding issues

2010-10-14 Thread Federico Calboli
Hi All, I'm running the now almost-to-be upgraded R 2.11.1 on a Intel Mac, and on a Ubuntu machine, but the problem I see is the same. I noticed the following behaviour: 407585.91 * 0.8 [1] 326068.7 -- the right asnwer is 326068.728 round(407585.91 * 0.8, 2) [1] 326068.7 -- same issue

[R] coxph and remaing events

2010-06-15 Thread Federico Calboli
Hi everyone, I'm running a cox ph model on a dataset with a number of variables. Each variable has a different number of missing data, so that coxph() drops the individuals who are missing data at one or more variables. Because of this dropping (totally fine btw) I want to know how many events

Re: [R] coxph and remaing events

2010-06-15 Thread Federico Calboli
On 15 Jun 2010, at 18:34, Federico Calboli wrote: I'm running a cox ph model on a dataset with a number of variables. Each variable has a different number of missing data, so that coxph() drops the individuals who are missing data at one or more variables. Because of this dropping (totally

[R] coxph and completely missing strata/subsetting

2010-06-10 Thread Federico Calboli
Hi everyone, I'm doing some coxph() analyses with a large and complex dataset. The data was collected in different centers, so I am using strata(centers) to stratify the analysis. My main issue is, not all centers collected all the variables, so for a model such as: coxph(Surv(days, cancer)

[R] multhist,labels and percentages

2010-05-14 Thread Federico Calboli
Hi All, I am in the annoying position of having to present some data to someone who seems to be somewhat less than numerate. I need to label the y-axes of a multhist with the y-axis labeled not as counts but as percentage of a population. Plotting the standard histogram is in a way fine, all I

Re: [R] multhist,labels and percentages

2010-05-14 Thread Federico Calboli
question were clearer, I might be able to help in more specific ways. -tgs On Fri, May 14, 2010 at 10:19 AM, Federico Calboli f.calb...@imperial.ac.uk wrote: Hi All, I am in the annoying position of having to present some data to someone who seems to be somewhat less than numerate. I need

Re: [R] multhist,labels and percentages

2010-05-14 Thread Federico Calboli
, May 14, 2010 at 11:51 AM, Federico Calboli f.calb...@imperial.ac.uk wrote: On 14 May 2010, at 16:09, Thomas Stewart wrote: Please be more specific with your question. Perhaps a simple subset of the data you are trying to plot? Here is some non-specific advice: Plotting histograms

[R] renaming factors *efficiently*

2010-04-13 Thread Federico Calboli
Hi All, I have a data frame where a couple of columns are factors, with long and complex names. Everything works ok --in R, but I need to export the data so it can be used on a dumber program (one with a three letters name starting with S...). I know that those complex factor names are causing

[R] R, NIH and FDA

2009-11-13 Thread Federico Calboli
Dear All, I will soon be working with NIH and possibly FDA. Will I be able to use R or will I be forced to use SAS? Cheers, Federico -- Federico C. F. Calboli Department of Epidemiology and Public Health Imperial College, St. Mary's Campus Norfolk Place, London W2 1PG Tel +44 (0)20

Re: [R] R, NIH and FDA

2009-11-13 Thread Federico Calboli
On 13 Nov 2009, at 12:25, Barry Rowlingson wrote: Working with is different to Working for. Assuming they want to work with you then they want you for your abilities and skills, and if those skills are with R then you go ahead and use R. You don't employ a bricklayer to build a wall and then

[R] when vectorising does not work: silent function fail?

2009-11-10 Thread Federico Calboli
Dear All, I'm using apply to do some genetic association analysis along a chromosome, with many thousands markers. For each marker the analysis is the same, so I was planning to use apply(chrom, 2, somefunction) In the specific case I do: my.results = apply(chr, 2, function(x){anova(lrm(

Re: [R] when vectorising does not work: silent function fail?

2009-11-10 Thread Federico Calboli
than a measly script. Cheers, Fede -thomas On Tue, Nov 10, 2009 at 10:04 AM, Federico Calboli f.calb...@imperial.ac.uk wrote: Dear All, I'm using apply to do some genetic association analysis along a chromosome, with many thousands markers. For each marker the analysis is the same

[R] vglm(), t values and p values

2009-11-04 Thread Federico Calboli
Hi All, I'm fitting an proportional odds model using vglm() from VGAM. My response variable is the severity of diseases, going from 0 to 5 (the severity is actually an ordered factor). The independent variables are: 1 genetic marker, time of medical observation, age, sex. What I *need* is a

Re: [R] vglm(), t values and p values

2009-11-04 Thread Federico Calboli
On 4 Nov 2009, at 18:11, Gavin Simpson wrote: Is there a particular reason for choosing a VGLM here? My reading of your post suggests the response is an univariate, ordered factor and VGLMs are especially for multivariate responses. In which case, can you not use polr() in package MASS that

Re: [R] vglm(), t values and p values

2009-11-04 Thread Federico Calboli
On 4 Nov 2009, at 18:40, Gavin Simpson wrote: Additionally, while extracting the t value is a piece of cake with polr(), the p-value I get a nowhere close to a null distribution. Yes - I see that polr() also doesn't produce p-values in the output from summary. You can use it to get a

[R] fitted.values less than observed values

2009-08-04 Thread Federico Calboli
Hi All, I have some data where the dependent variable is a score, low (1:3) or high (8:9), and the independent variables are 21 genotypic markers. I'm fitting a logistic regression on the whole dataset after transforming the score to 0/1 and normal linear regression on the high and low

Re: [R] fitted.values less than observed values

2009-08-04 Thread Federico Calboli
Actually, I tried doing data2 = unique(data) mod = lm(y ~ x1 + ... + xn, data2) fitted(mod) and I still get les fitted values than observations. Federico On 4 Aug 2009, at 12:18, Federico Calboli wrote: Hi All, I have some data where the dependent variable is a score, low (1:3) or high (8

Re: [R] fitted.values less than observed values

2009-08-04 Thread Federico Calboli
to the numbers involved? Even better would be small *reproducible* example. I'll have to cook that up, the data is more or less confidential. Not very much but enough no to go on google ;) F -- David On Aug 4, 2009, at 12:51 PM, Federico Calboli wrote: Actually, I tried doing data2 = unique

Re: [R] fitted.values less than observed values

2009-08-04 Thread Federico Calboli
On Aug 4, 2009, at 12:51 PM, Federico Calboli wrote: Actually, I tried doing data2 = unique(data) mod = lm(y ~ x1 + ... + xn, data2) fitted(mod) and I still get les fitted values than observations. Federico On 4 Aug 2009, at 12:18, Federico Calboli wrote: Hi All, I have some data where

Re: [R] tiff() woes

2009-06-18 Thread Federico Calboli
On 17 Jun 2009, at 18:15, Dirk Eddelbuettel wrote: On Wed, Jun 17, 2009 at 05:29:26PM +0100, Federico Calboli wrote: Hello all, a friend has a problem with tiff() which I was unable to help about. I searched the error messages to no avail. When he tries: tiff(filename

Re: [R] tiff() woes

2009-06-18 Thread Federico Calboli
I checked on the affected computer and both tiff and cairo capabiliies return FALSE. How that is I would not know, it's a bog standard R installation on windows XP. The 2.9.0 Windows install does not have TIFF capability. Try png() or something else. I don't know about that, but R is

[R] tiff() woes

2009-06-17 Thread Federico Calboli
Hello all, a friend has a problem with tiff() which I was unable to help about. I searched the error messages to no avail. When he tries: tiff(filename = FedeWhyDoesntThisBloodyWork.tif, width = 5, height = 5, units = cm, bg = white, res = 1200) Error in tiff(filename =

[R] problem with svyglm()

2009-04-02 Thread Federico Calboli
Hello, I'm trying to use the function svyglm in the library survey. I create a data survey object: data_svy- svydesign(id=~PSU, strata=~sample_domain, weights=~sample_weight, data=data, nest=TRUE) and I try to use svyglm() with little success:

[R] liknage analysis

2009-02-05 Thread Federico Calboli
Dear All, is there a package in R that implements parametric and non parametric genetic linkage analysis (with both case/control or quantitative phenos)? I tried using Merlin, which could not deal with pedigrees the size I have, and SimWalk2 does not look like the answer either --for

Re: [R] lme nesting/interaction advice

2008-05-12 Thread Federico Calboli
On 11 May 2008, at 22:45, Andrew Robinson wrote: lme(y ~ selection * males, random = ~1|replica/selection/males, mydata) forgive me, but I seem to see nesting in the random statement. That is what happens when we separate factors with a '/'; they are nested. We would expect that

Re: [R] lme nesting/interaction advice

2008-05-12 Thread Federico Calboli
On 12 May 2008, at 01:05, Andrew Robinson wrote: On Mon, May 12, 2008 at 10:34:40AM +1200, Rolf Turner wrote: On 12/05/2008, at 9:45 AM, Andrew Robinson wrote: On Sun, May 11, 2008 at 07:52:50PM +0100, Federico Calboli wrote: The main point of my question is, having a 3 way anova

Re: [R] lme nesting/interaction advice

2008-05-12 Thread Federico Calboli
On 12 May 2008, at 09:29, Dieter Menne wrote: Federico: First, mixed models are different from standard 101 Anova, and quite a lot of the nesting stuff I used to ponder about 30 year ago when I started teaching this is no longer relevant and works implicitely when you code the parameters

Re: [R] lme nesting/interaction advice

2008-05-12 Thread Federico Calboli
On 11 May 2008, at 23:34, Rolf Turner wrote: It doesn't seem to me to be a complaint as such. It is a request for insight. I too would like some insight as to what on earth is going on. And why do you say Federico shows no evidence of having searched the

Re: [R] [R-sig-ME] lme nesting/interaction advice

2008-05-12 Thread Federico Calboli
On 12 May 2008, at 10:05, Ken Beath wrote: There is only one random effect, so where does the crossing come from ? The fixed effects vary across blocks, but they are fixed so are just covariates. For this type of data the usual model in lme4 is y~fixed1+fixed2+1|group and for lme split into

Re: [R] lme nesting/interaction advice

2008-05-12 Thread Federico Calboli
On 12 May 2008, at 11:16, Andrew Robinson wrote: Well. I have documentation relevant to nlme that goes back about 10 years. I don't know when it was first added to S-plus, but I assume that it was about then. Now, do you think that if the thing that you want to do was really bog standard,

Re: [R] [R-sig-ME] lme nesting/interaction advice

2008-05-12 Thread Federico Calboli
On 12 May 2008, at 12:21, Nick Isaac wrote: I *think* the syntax for the model Federico wants is this: lmer(y~selection*males+ (selection|month) + (males|month)) I'll try and check against some back of the envelope calculations -- as I said, the model is, per se, nothing really new, and my

Re: [R] [R-sig-ME] lme nesting/interaction advice

2008-05-12 Thread Federico Calboli
On 12 May 2008, at 14:37, Doran, Harold wrote: I haven't followed this thread carefully, so apologies if I'm too off base. But, in response to Rolf's questions/issues. First, SAS cannot handle models with crossed random effects (at least well at all). SAS is horribly incapable of handling

Re: [R] [R-sig-ME] lme nesting/interaction advice

2008-05-12 Thread Federico Calboli
On 12 May 2008, at 17:09, Douglas Bates wrote: I'm entering this discussion late so I may be discussing issues that have already been addressed. As I understand it, Federico, you began by describing a model for data in which two factors have a fixed set of levels and one factor has an

Re: [R] lme nesting/interaction advice

2008-05-11 Thread Federico Calboli
of the nesting, in any case I attach a toy dataset I created especially to test how to specify the correct model (silly me). Best, Federico Calboli [1] So much bog standard that the Zar, IV ed, gives a nice table of how to compute the F-tests correctly, taking into account that one of the 3

Re: [R] lme nesting/interaction advice

2008-05-09 Thread Federico Calboli
Note that random can be a list: a one-sided formula of the form ~x1+...+xn, or a pdMat object with a formula (i.e. a non-NULL value for formula(object)), or a list of such formulas or pdMat objects. If you can translate that into *informative* English I'd be grateful. I have the Pinheiro

[R] lme nesting/interaction advice

2008-05-08 Thread Federico Calboli
Hi everyone, I am confused on how to specify some nesting and interaction terma with lme(). I have a dataset where some flies where selected for accessory gland size, made to mate in presence/absence of another male and the level of some protein measured. Now the complex stuff. The

[R] predicting memory usage

2008-02-18 Thread Federico Calboli
Hi All, is there a way of predicting memory usage? I need to build an array of 86000 by 2500 numbers (or I might create a list of 2 by 2500 arrays 43000 long). How much memory should I expect to use/need? Cheers, Fede -- Federico C. F. Calboli Department of Epidemiology and Public Health

[R] writing summary() to a text file

2007-11-26 Thread Federico Calboli
Hi All, I would like to output the results of a function into a text file, legible as a such. The function produces a summary quite like: summary(lm(x ~ y + w * z)) [for instance] and I am not clear how to save this summary into a text file 'automagically', because I need to be able to do

[R] errorbar il lattice plot

2007-09-28 Thread Federico Calboli
, dn, lwd = lwd, lty = 1, col = colour) segments(wid.lf, up, wid.rt, up, lwd = lwd, lty = 1, col = colour) segments(wid.lf, dn, wid.rt, dn, lwd = lwd, lty = 1, col = colour) } invisible(data.frame(x, up, dn)) } } ) Regards, Federico Calboli -- Federico C. F. Calboli