Re: [R] how to define a geometric distribution for "glm"

2014-10-27 Thread Amanda Li
hatever, family="binomial") > > [The likelihood equivalence is fairly well-known in statistical theory as > a counterargument to the strong likelihood principle that all inference > should be based solely on the likelihood function.] > > - Peter D. > > > On 27 Oct 2014,

[R] how to define a geometric distribution for "glm"

2014-10-27 Thread Amanda Li
Hello, I was trying to apply "glm" to a dataset that assumes geometric distribution. I cannot use "glm.nb" in MASS package (negative.binomial (1)) because it tries to estimate this "1" while I am interested in "p", the probability of success. Does anyone know how I can define a geometric distribut

[R] likelihood ratio test for mean difference assuming unequal variance

2014-01-13 Thread Amanda Li
Hello, I am so sorry, but I have been struggling with the code for the entire day. I have a very simple dataset that looks like this: response=c(45,47,24,35,47,56,29) sub=c("A","A","B","B","C","C","C"£© time=c(1,2,1,2,1,2,3) gdata=cbind(response,sub,time) Namely, for three subjects, each has 2 o

[R] Apply function to do pairwise calculation

2013-09-30 Thread Amanda Li
Hello, I want to do pairwise calculation, but I am not sure how to do so. i.e. I have a correlation matrix M 200*200. Namely colnames(M)=rownames(M). In addition, colnames(M) is one of A, B, C, D. I want to first sort the matrix M into 16 modules according to colnames and rownames, and then apply

[R] write a function to do pairwise calculation

2013-06-17 Thread Amanda Li
Hello, I want to write a function to do pairwise calculation, but I don' know how to write it. Could anyone help? i.e. I have A (2*3), B(3*3), C(4*3) three matrices. I want to calculate distance correlation between each pair of matrices using code "dcor". How do I write a function so that I can g