similar to: Help using tapply with multiple variables

Displaying 20 results from an estimated 3000 matches similar to: "Help using tapply with multiple variables"

2007 Sep 27
1
Reading SAS SD2 Data file
I am trying to read a SAS dataset into R that is in a .SD2 format, which is the Version 6 standard format from SAS. I see the routines that read the SAS XPORT format (foreign, Hmisc), but is there any way to read this one? Any help would be greatly appreciated. Corey Sparks Corey Sparks Assistant Professor Department of Demography and Organization Studies University of Texas-San Antonio One UTSA
2011 Oct 13
1
Axis Formats with library(car)
I am trying to develop scatter plots using library(car). However, the output I am getting shows the axis (x and y) in scientific notation. I want to have the axis represented by regular integers (for eg. the X axis i want the upper bound to show as 40,000,000 instead of 4.0e+07). Scanning the r-help archives did not get me the answer. I have uploaded my data here: http://bit.ly/olgMLt
2009 Feb 25
1
Using gregexpr with multiple search elements
Dear list, I am trying to use gregexpr to see if entries in a dataframe have either of two possible values for a string. here's an example text<-c("fat", "rat", "cat", "dog", "log", "fish") If I just wanted to find if any one of the elements in text match the pattern "at" I would do gregexpr("\\at", text)
2008 Jul 16
4
Likelihood ratio test between glm and glmer fits
Dear list, I am fitting a logistic multi-level regression model and need to test the difference between the ordinary logistic regression from a glm() fit and the mixed effects fit from glmer(), basically I want to do a likelihood ratio test between the two fits. The data are like this: My outcome is a (1,0) for health status, I have several (1,0) dummy variables RURAL, SMOKE, DRINK, EMPLOYED,
2007 Dec 05
4
coxme frailty model standard errors?
Hello, I am running R 2.6.1 on windows xp I am trying to fit a cox proportional hazard model with a shared Gaussian frailty term using coxme My model is specified as: nofit1<-coxme(Surv(Age,cen1new)~ Sex+bo2+bo3,random=~1|isl,data=mydat) With x1-x3 being dummy variables, and isl being the community level variable with 4 levels. Does anyone know if there is a way to get the standard error
2010 Jan 05
1
Multivariate Poisson GLM??
Dear R Users, I'm working on a problem where I have a multivariate response vector of counts and a continuous predictor. I've thought about doing this the same way you would do a Multvariate regression model with normally distributed data, but since these data are counts, they are probably better modeled with a Poisson distribution. For example y1<-rpois(100,3.5) y2<-rpois(100,1.5)
2010 Mar 10
1
Strange result in survey package: svyvar
Hi R users, I'm using the survey package to calculate summary statistics for a large health survey (the Demographic and Health Survey for Honduras, 2006), and when I try to calculate the variances for several variables, I get negative numbers. I thought it may be my data, so I ran the example on the help page: data(api) ## one-stage cluster sample dclus1<-svydesign(id=~dnum, weights=~pw,
2011 Jun 24
3
Fwd: Extract element of a list based on an index value
> Dear list, > > I have some data on a geneaology, here is a subset: > warmerge[1:11,c(1,6,25)] > Warrior SibID birth.year > 1100 3793 2013 1926 > 4 2013 2024 1934 > 1094 3769 2024 1918 > 632 2747 2037 1928 > 176 2083 2039 1944 > 187 2085 2039 1949 > 192 2086 2039 NA > 495
2012 May 20
2
Remus network buffering problem
Hi all, I have a following problem: - Remus network buffering doesn''t work. It seems to be because of no vif is reported by the function server.xend.domain on line 29 of /usr/local/lib/python2.7/dist-packages/xen/remus/vm.py (seen using pdb) : 27 if domid: 28 try: 29 self.dominfo = server.xend.domain(domid, ''all'') >
2012 Feb 10
4
qemu-xen qdisk performance
Hello, I''ve recently setup a Linux Dom0 with a 3.0.17 kernel and Xen 4.1.2, and since the 3.x series doesn''t have blktap support I''m using qdisk to attach raw images. I''ve been playing with small images, something like 1GB, and everything seemed fine, speed was not fantastic but it was ok. Today I''ve set up a bigger machine, with a 20GB raw hdd and the
2008 Jan 29
2
Using Predict and GLM
Dear R Help, I read through the archives pretty extensively before sending this email, as it seemed there were several threads on using predict with GLM. However, while my issue is similar to previous posts (cannot get it to predict using new data), none of the suggested fixes are working. The important bits of my code: set.seed(644) n0=200 #number of observations
2012 Apr 03
3
regression for poisson distributed data
Hello all, I would like to get parameter estimates for different models. For one of them I give the code in example. I am estimating the parameters (i,j and k) with the nls function, which sees the error distribution as normal, I would however like to do the same as nls with the assumption that the errors are poisson distributed. Is there a way to do this with R? Are there packages designed
2012 Apr 19
1
non-numeric argument in mle2
Hi all, I have some problems with the mle2 function > RogersIIbinom <- function(N0,attackR3_B,Th3_B) {N0-lambertW(attackR3_B*Th3_B*N0*exp(-attackR3_B*(24-Th3_B*N0)))/(attackR3_B*Th3_B)} > RogersII_B <- mle2(FR~dbinom(size=N0,prob=RogersIIbinom(N0,attackR3_B,Th3_B)/N0),start=list(attackR3_B=1.5,Th3_B=0.04),method="Nelder-Mead",data=dat) Error in dbinom(x, size, prob, log)
2006 Jul 03
2
help a newbie with a loop
Hi, I am new in R and stumbled on a problem my (more experienced) friends can not help with with. Why isnt this code working? The function is working, also with the loop and the graph appears, only when I build another loop around it (for different values of p) , R stays in a loop? Can't it take more then 2 loops in one program? powerb<-function(x,sp2,a,b,b1,m) {
2019 Mar 13
2
llvm combines "ADD frameindex, constant" to OR
Hi all, I've been working on a backend of our architecture and noticed llvm performs following combining although one of operands is FrameIndex. Combining: t114: i64 = add FrameIndex:i64<0>, Constant:i64<56> Creating new node: t121: i64 = or FrameIndex:i64<0>, Constant:i64<56> ... into: t121: i64 = or FrameIndex:i64<0>, Constant:i64<56> This
2010 Aug 10
4
Function to Define a Function
I am trying to define a general R function that has a function as the output that depends on the user's input arguments (this may make more sense by looking at the toy example below). My real use for this type of code is to allow a user to choose from many parameterizations of the same general model. My "issue" is that when I compile a package with this type of code in it I get a
2009 Sep 22
2
Subsetting dataframes based on column names
Dear R users, I am interested in taking the columns from multiple dataframes, the problem is that the different dataframes have different combinations of the same variable names, here's a simple example: a<-rep(1:10) b<-rep(1:10) c<-rep(21:30) d<-rep(31:40) dat.a<-data.frame(a,b,c,d) names(dat.a)<-c("a", "b", "c", "d")
2012 Apr 18
1
error estimating parameters with mle2
Hi all, When I try to estimate the functional response of the Rogers type I equation (for the mle2 you need the package bbmle): > RogersIbinom <- function(N0,attackR2_B,u_B) {attackR2_B+u_B*N0} > RogersI_B <- mle2(FR~dbinom(size=N0,prob=RogersIbinom(N0,attackR2_B,u_B)/N0),start=list(attackR2_B=4.5,u_B=0.16),method="Nelder-Mead",data=data5) I get following error message
2010 Oct 21
4
data.frame query
Hi All, Apologies for the simplicity of my question, but I would be grateful for any advice. Thanks I'm trying to put the output from a for loop into a data frame, however I have not been successful. The steps I have taken are: *R-code:* >for (k in 1:(nt-1-n0) ){ > n<- n0-1+k > lam=n/nt > Q=x[n] > output1<-data.frame(cbind(k,n,lam,Q)) > output1 > }
2002 Aug 07
2
indexing matrices with dimnames?
I've got a covariance matrix that I'd like to index using the dimnames: > vcov1 n0 x0 s n1 n2 n0 82.43824759 1.839505e-02 -4.975196e-01 2.882394e+03 -2.615986e-01 x0 0.01839505 6.134010e-03 -7.695922e-04 -6.373946e+01 6.086321e-03 s -0.49751964 -7.695922e-04 9.638943e-03 3.406594e+02 -3.173671e-02 n1 2882.39407745