[R] glm - rgamma vector as predictor

2014-10-08 Thread Wim Kreinen
I have a strange question concerning the fit of a Gamma generalized linear model with glm (and further using gamma.shape to measure the shape parameter). Actually, I started with rgamma to generate some random vectors because I wanted to play around with various conditions (and become familiar

[R] restructure my data

2013-09-02 Thread Wim Kreinen
My data is in this form: var has 3 conditions (0,1,2) df var cauc 11 6462.3288 20 1585.2740 30 2481.6781 41 344.1781 50 8871.5753 62 816.7808 72 6031.3356 80 1013.5274 92 4913.5274 10 0 1517.2500 For the three conditions (0,1,2) I want the

[R] Q-Q plot for chi-quadrat w/o knowing the contingency table

2013-03-17 Thread Wim Kreinen
Hello, I have chi2-values from 2x2 contingency tables, each degree of freedom =1. But I dont know the values of the contingency table. All I have in addtion: The allelic odds ratio. Now I would like to do a Q-Q-plot. Is that possible? If yes, please let me know. If no, please let me know as well.

[R] Transform every integer to 1 or 0

2013-02-05 Thread Wim Kreinen
Hello, I have a dataframe with positive integers and for every value 0 I would like to have 1 and the rest should be zero. For instance 1 0 1 0 1 1 with df as reference. df V1 V2 V3 yes 23 0 5 no 0 5 7 dput (df) structure(list(V1 = c(23, 0), V2 = c(0, 5), V3 = c(5, 7)), .Names =

Re: [R] Transform every integer to 1 or 0

2013-02-05 Thread Wim Kreinen
Thanks (acutally same as Richard's) this was very helpful 2013/2/5 arun smartpink...@yahoo.com Hi, You could try: df[df0]-1 #or df[]-as.integer(df!=0) df #V1 V2 V3 #yes 1 0 1 #no 0 1 1 A.K. - Original Message - From: Wim Kreinen wkrei...@gmail.com To: r-help

[R] glm poisson and quasipoisson

2013-01-31 Thread Wim Kreinen
Hello, I have a question about modelling via glm. I have a dataset (see dput) that looks like as if it where poisson distributed (actually I would appreciate that) but it isnt because mean unequals var. mean (x) [1] 901.7827 var (x) [1] 132439.3 Anyway, I tried to model it via poisson and

Re: [R] From table to data.frame

2013-01-25 Thread Wim Kreinen
This idea is very simple and helpful. But one has to start with 0.05. Thanks. test.df$n- seq(0.05,1, by=0.05) 2013/1/24 Rui Barradas ruipbarra...@sapo.pt Hello, try the following. test.df$Var1 - seq(0,1, by=0.05)[-1] test.df Hope this helps, Rui Barradas Em 24-01-2013 17:39, Wim

[R] summarise subsets of a vector

2013-01-22 Thread Wim Kreinen
Hello, I have vector called test. And now I wish to measure the mean of the first 10 number, the second 10 numbers etc How does it work? Thanks Wim dput (test) c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,