[R] logistic regression and dummy variable coding

2007-06-28 Thread Bingshan Li
Hello everyone, I have a variable with several categories and I want to convert this into dummy variables and do logistic regression on it. I used model.matrix to create dummy variables but it always picked the smallest one as the reference. For example,

Re: [R] logistic regression and dummy variable coding

2007-06-28 Thread Bingshan Li
On 6/28/07, Bingshan Li [EMAIL PROTECTED] wrote: Hello everyone, I have a variable with several categories and I want to convert this into dummy variables and do logistic regression on it. I used model.matrix to create dummy variables but it always picked the smallest one as the reference

[R] power of logistic regression in case control design

2007-06-07 Thread Bingshan Li
Hi All, This is not directly related to R but I post the questions here since there are a lot of experts on statistics. I want to calculate power of logistic regression using likelihood ratio test in unmatched case control design. The paper I have read is power calculations for likelihood

[R] power 2x3 exact test

2007-05-09 Thread Bingshan Li
Hi, all, I am wondering if there is an algorithm for calculating power of 2x3 table using Fisher exact test. There is one (algorithm 280) for 2x2 Fisher exact test but I couldn't find one for 2x3 table. If we are not lucky enough to have one, is there any other way to calculate exact

[R] logistic regression on contingency table

2007-03-04 Thread Bingshan Li
Hi folks, I am wondering if there is a way in R to fit logistic regression on contingency table. If I have original data, I can transform the data into a design matrix and then call glm to fit the regression. But now I have a 2x3 contingency table with first row for response 0 and second

[R] legends in a plot

2006-09-22 Thread Bingshan Li
Hi there, I have the following plot. The circles and the line do not cross in the main plot. But in the legend, the circle and the line cross. I am wondering if there is a way to make the legend look like the plot without crossing. I looked around but did not find a way to do that. Is it

[R] using table in R

2006-09-18 Thread Bingshan Li
Hi there, I have a dataframe whose elements are numbers or characters. I want to extract the frequencies of each elements in the dataframe. For example, d = as.data.frame(matrix(c(1, 2, 3, 3), 2,2)) What I want is first what are the elements in the data (1,2,3 here) and second what are

[R] merge strings

2006-09-17 Thread Bingshan Li
Hi all, I have a vector and want to merge its elements one by one into a single string or number. For example, x=c(1,2,3), what I want is a new number 123. I used paste but it just output 1 2 3 which is not what I want. Is there any way to do this? Thanks!

Re: [R] merge strings

2006-09-17 Thread Bingshan Li
Hi Duncan Murdoch, Thanks for the trick and it works! --- Duncan Murdoch [EMAIL PROTECTED] wrote: Bingshan Li wrote: Hi all, I have a vector and want to merge its elements one by one into a single string or number. For example, x=c(1,2,3), what I want is a new number 123. I used

[R] using table in R

2006-09-16 Thread Bingshan Li
Hi there, I have a dataframe whose elements are numbers or characters. I want to extract the frequencies of each elements in the dataframe. For example, d = as.data.frame(matrix(c(1, 2, 3, 3), 2,2)) What I want is first what are the elements in the data (1,2,3 here) and second what are their

Re: [R] using table in R

2006-09-16 Thread Bingshan Li
2 On 9/16/06, Bingshan Li [EMAIL PROTECTED] wrote: Hi there, I have a dataframe whose elements are numbers or characters. I want to extract the frequencies of each elements in the dataframe. For example, d = as.data.frame(matrix(c(1, 2, 3, 3), 2,2)) What I want is first