similar to: Apply or Tapply to Build Set of Tables

Displaying 20 results from an estimated 3000 matches similar to: "Apply or Tapply to Build Set of Tables"

2011 Dec 13
8
How to compute 95%CI for OR from logistic regression?
Hi all: My data has 3 variables: age(3levels : <30y=1 30-50y=2, >50y=3) gender(Male=0, Female=1) CD4 cell count(raw lab measurement) y(1:death 0:alive) I perform logistic regression to find out the factors that influence y. result<-glm(y ~ factor(age) + factor(gender) + CD4,family = binomial) >From the result,I can get OR(Odds Ratio) of gender via exp(Estimate of Female,
2006 Mar 23
2
clogit question
Hi, I am playing with clogit(case~spontaneous+induced+strata(stratum),data=infert) from clogit help file. This line works. 1. But, why strata(stratum) doesn't have a coefficient like spontaneous and induced? 2. When I remove strata(stratum) from the command, this function seems to keep running forever. Why? 3. I think the equation for clogit looks like P=1/(1+
2009 Jan 29
1
Question On CrossTable function in gmodels package
Hi R-users, I have the following problem with CrossTable function within ?gmodels? package: the output of the function (format ?spss? and asresid=T) can not be stored within another object. For example: >library(gmodels) >data(infert, package = "datasets") > CrossTable(infert$education, infert$induced)->aa # the function prints everything ok on the screen > aa # works
2009 Jun 17
2
glm binomial logit
Hi All, I am using "glm" function to build logistic regression. I noticed that glm function glm function is computing many other statistics which are not required for our analysis. As our dataset is very big and we have to run logistic regression on several samples the run time drastically increases if all those statistics are computed. Is these any way to skip computation in glm
2009 Dec 02
2
Error when running Conditional Logit Model
Dear R-helpers, I am very new to R and trying to run the conditional logit model using "clogit " command. I have more than 4000 observations in my dataset and try to predict the dependent variable from 14 independent variables. My command is as follows clmtest1 <- clogit(Pin~Income+Bus+Pop+Urbpro+Health+Student+Grad+NE+NW+NCC+SCC+CH+SE+MRD+strata(IDD),data=clmdata) However, it
2009 Jun 30
1
fitting in logistic model
I would like to know how R computes the probability of an event in a logistic model (P(y=1)) from the score s, linear combination of x and beta. I noticed that there are differences (small, less than e-16) between the fitting values automatically computed in the glm procedure by R, and the values "manually" computed by me applying the reverse formula p=e^s/(1+e^s); moreover I noticed
2011 Dec 12
1
k-folds cross validation with conditional logistic
--begin inclusion -- I have a matched-case control dataset that I'm using conditional logistic regression (clogit in survival) to analyze. I'm trying to conduct k-folds cross validation on my top models but all of the packages I can find (CVbinary in DAAG, KVX) won't work with clogit models. Is there any easy way to do this in R? -end inclusion -- The clogit funciton is simply a
2005 Feb 02
4
(no subject)
can you recommend a good manual for R that starts with a data set and gives demonstrations on what can be done using R? I downloadedR Langauage definition and An introduction to R but haven't found them overly useful. I'd really like to be able to follow some tutorials using a dataset or many datasets. The datasets I have available on R are Data sets in package 'datasets':
2006 Dec 12
1
Calculating AICc using conditional logistic regression
I have a case-control study that I'm analysing using the conditional logistic regression function clogit from the survival package. I would like to calculate the AICc of the models I fit using clogit. I have a variety of scripts that can calculate AICc for models with a logLik method, but clogit does not appear to use this method. Is there a way I can calculate AICc from clogit in R? Many
2008 Aug 31
1
Fitted probabilities in conditional logit regression
Dear R-help, I'm doing conditional logit regression for a discrete choice model. I want to know whether there's a way to get the fitted probabilities. In Stata, "predict" works for clogit, but it seems that in R "predict" does not. Thank you very much! Best wishes. Sincerely, Min -- Min Chen Graduate Student Department of Agricultural,
2008 Oct 05
1
plyr package: passing further arguments fail
Dear list and Hadley, The new plyr package seems to provide a clean and consistent way to apply a function on several arguments. However, I don't understand why the following example does not work like the standard mapply, library(plyr) df <- data.frame(a=1:10 , b=1:10) foo1 <- function(a, b, cc=0, d=0){ a + b + cc + d } mdply(df, foo1, cc=1) # fine mdply(df, foo1, d=1) #
2011 Feb 01
1
dotchart {graphics} 2.11.1 vs. 2.12.1 [followed up from Rhelp]
Dear List, With the R 2.12.0 addition of table methods for points(), dotchart() struggles with tables. I found several possible solutions, but it is beyond my skill to decide what is "best". Here is a small example: ############################################# x <- table(infert$education) y <- 1:3L dotchart(x) # error about incorrect plot type ## moving closer to the cause,
2010 Oct 28
1
xyplot and panel.curve
Hi All I have regression coefficients from an experiment and I want to plot them in lattice using panel curve but I have run into error messages. I want an 3 panel conditioned plot of 2 curves of Treatment 2 in each panel conditioned by Treatment1, the example curve expression is x+value*x^2 A rough toy example to give an idea of what I want is: Data: data = expand.grid(Treatment1 =
2010 Nov 12
1
Xapply question
Dear list, I'm stuck with looking for a function of the *apply family, which I suppose exists already ? just I can't find it: What I'm looking for is somewhere between sweep and mapply that does a calculation vectorized over a matrix and a vector: It should work complementary to sweep: for each row of the matrix, a different value of the vector should be handed over. Close to
2011 Aug 03
1
create a list under constraints
Hi, R users, Here is an example. k <- c(1,2,3,4,5) i <- c(0,1,3,2,1) if k=1, then i=0 if k=2, then i=0, 1 if k=3, then i=0, 1, 2, 3 if k=4, then i=0, 1, 2 if k=5, then i=0, 1 so i'd like to create a list like below. > list k i 1 1 0 2 2 0 3 2 1 4 3 0 5 3 1 6 3 2 7 3 3 8 4 0 9 4 1 10 4 2 11 5 0 12 5 1 I tried expand.grid, but I can't. Any suggestion will be
2011 May 25
1
Subtracting rows by id
Dear R users, I have two datasets: id1 <- c(rep(1,10), rep(2,10), rep(3,10)) value1 <- sample(1:100, 30, replace=TRUE) dataset1 <- cbind(id1,value1) id2 <- c(1,2,3) subtract.value <- c(1,3,5) dataset2 <- cbind(id2, subtract.value) I want to subtract the number of rows in the subtract.value that corresponds to the id value in dataset1. So for the 1 in id1, I want to
2010 Sep 14
3
rnorm using vector of means and SDs
Hi, I want to sample from a distribution (say a normal distribution, for example) using vectors of the different parameters (i.e. the mean and standard deviation). That is, I have a list/vector of say 100 means and another of the corresponding 100 SD's, and I want a matrix of 100 rows (one for each mean and SD pair) each having 1000 random samples. Something like: sample_matrix =
2005 Jun 23
1
the dimname of a table
i have a data frame(dat) which has many variables.and i use the following script to get the crosstable. >danx2<-c("x1.1","x1.2","x1.3","x1.4","x1.5","x2","x4","x5","x6","x7","x8.1","x8.2","x8.3","x8.4","x11",
2011 Jun 17
3
rle on large data . . . without a for loop!
I think need to do something like this: dat<-data.frame(state=sample(id=rep(1:5,each=200),1:3, 1000, replace=T,prob=c(0.7,0.05,0.25)),V1=runif(1,10,1000),V2=rnorm(1000)) rle.dat<-rle(dat$state) temp<-1 out<-data.frame(id=1:length(rle.dat$length)) for(i in 1:length(rle.dat$length)){ temp2<-temp+rle.dat$length[[i]] out$V1[i]<-mean(dat$V1[temp:temp2])
2016 May 09
5
Internal RAID controllers question
On 08/05/16 09:02 PM, Valeri Galtsev wrote: > > On Sun, May 8, 2016 7:31 pm, Digimer wrote: >> On 08/05/16 08:12 PM, John R Pierce wrote: >>> On 5/6/2016 2:26 PM, Valeri Galtsev wrote: >>>> Which internal hardware RAID controllers will survive some future to >>>> come >>>> in your estimate. First of all my beloved 3ware finally seems to