Re: [R] Plot by FIPS Code using Shapefiles

2015-05-06 Thread Corey Sparks
y.org/wp-content/uploads/2013/04/9.-Sparks.pdf <http://spatialdemography.org/wp-content/uploads/2013/04/9.-Sparks.pdf> look at page 134 of that pdf. Hope this helps - Corey Sparks, PhD Assistant Professor Department of Demography University of Texas at San Antonio 501 West César E. C

Re: [R] Reading data from Census API into R

2014-02-06 Thread Corey Sparks
nty 258458 Anderson County48001 314786 Andrews County48003 486771 Angelina County48005 523158 Aransas County48007 6 9054Archer County48009 7 1901 Armstrong County48011 - Corey Sparks, PhD Assistant Professor Depa

[R] Reading data from Census API into R

2014-02-06 Thread Corey Sparks
1","Angelina County","48","005"], ["23158","Aransas County","48","007"], ["9054","Archer County","48","009"], ["1901","Armstrong County","48","011"

Re: [R] Visualizing a dissimilarity matrix in Euclidean space

2011-07-09 Thread Corey Sparks
your notwork nodes. CS - Corey Sparks, PhD Assistant Professor Department of Demography and Organization Studies University of Texas at San Antonio 501 West Durango Blvd Monterey Building 2.270C San Antonio, TX 78207 210-458-3166 corey.sparks 'at' utsa.edu https://rowdyspace.utsa.e

Re: [R] Fwd: Extract element of a list based on an index value

2011-06-24 Thread Corey Sparks
Solved it: oldest<-unlist(tapply(warmerge$birth.year, warmerge$SibID,function(x) ifelse (x==min(x, na.rm=T)|is.na(x)==T,1,0))) ----- Corey Sparks, PhD Assistant Professor Department of Demography and Organization Studies University of Texas at San Antonio 501 West Durango Blvd Monte

[R] Openbugs and rbugs on mac with wine

2011-01-12 Thread COREY SPARKS
Hello list, I’ve been trying to get OpenBUGS running on my mac using the wine emulator. I can run Openbugs just fine by doing: wine ~/OpenBUGS312/OpenBUGS.exe In the terminal, so OpenBUGS works. When I try to run the schools example using rbugs(), the OpenBUGS process starts in wine, but it ju

[R] Openbugs and rbugs on mac with wine

2011-01-12 Thread Corey Sparks
/en_US.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] R2WinBUGS_2.1-16 coda_0.14-2 lattice_0.19-13 rbugs_0.4-9 loaded via a namespace (and not attached): [1] grid_2.12.1 tools_2.12.1 Thanks, Corey Corey Sparks Assistan

Re: [R] question about the chow test of poolability

2011-01-10 Thread Corey Sparks
Can you provide an example of your code? - Corey Sparks, PhD Assistant Professor Department of Demography and Organization Studies University of Texas at San Antonio 501 West Durango Blvd Monterey Building 2.270C San Antonio, TX 78207 210-458-3166 corey.sparks 'at' utsa

Re: [R] R equivalent of SAS proc freq

2010-07-25 Thread Corey Sparks
you can use prop.tables() on a table() object to get %ages, does this do what you need? - Corey Sparks, PhD Assistant Professor Department of Demography and Organization Studies University of Texas at San Antonio 501 West Durango Blvd Monterey Building 2.270C San Antonio, TX 78207 210-458

Re: [R] Multilevel survival model

2010-07-23 Thread Corey Sparks
check out the coxme and the kinship packages, both have the capability to fit the Cox proportional hazard model in a multi-level setting, or you could use glmer in lme4 to fit discrete-time (logistic) models with random intercepts. CS - Corey Sparks, PhD Assistant Professor Department of

Re: [R] Neural Network

2010-07-18 Thread Corey Sparks
I'd start with the nnet library type: ?nnet CS - Corey Sparks, PhD Assistant Professor Department of Demography and Organization Studies University of Texas at San Antonio 501 West Durango Blvd Monterey Building 2.270C San Antonio, TX 78207 210-458-3166 corey.sparks 'at'

Re: [R] grouped logit regression

2010-07-07 Thread Corey Sparks
the binomial regression model summary(fit) will print the coefficients and model fit In the future could you please read the posting guide and put in a data example or some R code you have tried. CS - Corey Sparks, PhD Assistant Professor Department of Demography and Organization Studies

Re: [R] Euclidean Distance Matrix Analysis (EDMA) in R?

2010-06-27 Thread Corey Sparks
I agree, i've seen procrustes in R, but not EDMA, R has natural support for bootstrapping via the boot() library, i'm sure others would be grateful if you wanted to write some functions.. CS Corey Sparks Assistant Professor Department of Demography and Organization Studies College

Re: [R] Calculating Summaries for each level of a Categorical variable

2010-06-27 Thread Corey Sparks
the variable you want to analyze (first argument to tapply) and the variable you want to analyze by (the factor, second arg to tapply) both must have the same number of rows, that' s how I read this. CS Corey Sparks Assistant Professor Department of Demography and Organization St

Re: [R] Euclidean Distance Matrix Analysis (EDMA) in R?

2010-06-26 Thread Corey Sparks
I think the hardest thing about true EDMA (meaning the Richtsmeier and Lele version) is the bootstrapping to get significance. Have you tried their software? http://www.getahead.psu.edu/resource_new.html - Corey Sparks, PhD Assistant Professor Department of Demography and Organization

Re: [R] Calculating Summaries for each level of a Categorical variable

2010-06-26 Thread Corey Sparks
Did you try tapply? ?tapply tapply(RT, RT$R, fun=WA) or something like that - Corey Sparks, PhD Assistant Professor Department of Demography and Organization Studies University of Texas at San Antonio 501 West Durango Blvd Monterey Building 2.270C San Antonio, TX 78207 210-458-3166

Re: [R] Scree diagram,

2010-05-02 Thread Corey Sparks
There is a screeplot() function that takes the output from prcomp. It plots the value of the eigenvalue vs. the eigenvalue's number. CS - Corey Sparks, PhD Assistant Professor Department of Demography and Organization Studies University of Texas at San Antonio 501 West Durango Blvd Mon

Re: [R] Event History Data Recoding

2010-04-23 Thread Corey Sparks
- Corey Sparks, PhD Assistant Professor Department of Demography and Organization Studies University of Texas at San Antonio 501 West Durango Blvd Monterey Building 2.270C San Antonio, TX 78207 210-458-3166 corey.sparks 'at' utsa.edu https://rowdyspace.utsa.edu/users/ozd504/www/index.htm --

Re: [R] Multilevel modeling with count variables

2010-03-26 Thread Corey Sparks
Whoops, sorry that's pt(), not dt() Thanks Dennis! - Corey Sparks, PhD Assistant Professor Department of Demography and Organization Studies University of Texas at San Antonio 501 West Durango Blvd Monterey Building 2.270C San Antonio, TX 78207 210-458-3166 corey.sparks 'at'

Re: [R] Multilevel modeling with count variables

2010-03-26 Thread Corey Sparks
asking? With regard to the t-statistics generated from lmer/glmer, you can get p-values by using dt(), or look at your confidence intervals for the parameters. Does this help? Corey - Corey Sparks, PhD Assistant Professor Department of Demography and Organization Studies University of Texas

Re: [R] 1 - Survival Plot

2010-03-25 Thread Corey Sparks
if you do: fit<-survfit (Surv(DTDMRS3, DMRS3) ~ RS2540477) fit$surv will have the survival function, and fit$time will have the failure times, these should give you what you want Hope this helps Corey ----- Corey Sparks, PhD Assistant Professor Department of Demography and Organizat

Re: [R] Strange result in survey package: svyvar

2010-03-10 Thread Corey Sparks
Fair enough. CS - Corey Sparks, PhD Assistant Professor Department of Demography and Organization Studies University of Texas at San Antonio 501 West Durango Blvd Monterey Building 2.270C San Antonio, TX 78207 210-458-3166 corey.sparks 'at' utsa.edu https://rowdyspace.utsa.edu/us

[R] Strange result in survey package: svyvar

2010-03-10 Thread Corey Sparks
ase other attached packages: [1] survey_3.19 loaded via a namespace (and not attached): [1] tools_2.10.1 And have the same error on a linux server. Thanks, Corey -- Corey Sparks Assistant Professor Department of Demography and Organization Studies University of Texas at San Antonio 501 West Du

Re: [R] Displaying political boundaries

2010-03-10 Thread Corey Sparks
the sp library to display your variable. Corey - Corey Sparks, PhD Assistant Professor Department of Demography and Organization Studies University of Texas at San Antonio 501 West Durango Blvd Monterey Building 2.270C San Antonio, TX 78207 210-458-3166 corey.sparks 'at' utsa

Re: [R] logistic regression by group?

2010-03-04 Thread Corey Sparks
ial, subset=group==1) fit.2<-glm(y~x1+x2, data=yourdat, family=binomial, subset=group==2) where group is your grouping variable. Which should give you that kind of stratified model. Hope this helps, Corey - Corey Sparks, PhD Assistant Professor Department of Demography and Organization S

Re: [R] Three most useful R package

2010-03-03 Thread Corey Sparks
3 most used packages: 1)spdep (for spatial regression/statistics) 2)car 3)survival (which is recommended, so) 3.5) survey (for analysis of complex survey samples) Best to all, Corey - Corey Sparks, PhD Assistant Professor Department of Demography and Organization Studies University of Texas

Re: [R] R Output and ArcGIS

2010-01-26 Thread Corey Sparks
Yes, R thinks the coordinates are characters, that needs to change. Also, alternatively you could use the write .dbf function in the foreign() library, ArcGis likes dbf files (just no long names) Corey - Corey Sparks, PhD Assistant Professor Department of Demography and Organization

Re: [R] R ON Mac

2010-01-14 Thread Corey Sparks
Hi, it appears that your corrdinates contain commas, instead of decimal points, R sees the commas and immediatly thinks the data are text, you should replace the commas with decimal points in a text editor. Corey gedasg wrote: > > hello, I have strange error. > > > gyliai<-read.table(file.cho

[R] Multivariate Poisson GLM??

2010-01-05 Thread Corey Sparks
: (subscript) logical subscript too long If anyone has experience with a multivariate Poisson response vector I would gladly appreciate any suggestions. Corey Sparks -- Corey Sparks Assistant Professor Department of Demography and Organization Studies University of Texas at San Antonio 501 We

Re: [R] Spatial Autocorrelation

2009-10-06 Thread Corey Sparks
Hi Paulo, if your data are distance matrices, you might consider doing a Mantel test, look at the mantel() function in package vegan. While this is not technically measuring spatial autocorrelation, it will test for correlation between the attribute distances and the geographic distances. Also,

[R] Subsetting dataframes based on column names

2009-09-22 Thread Corey Sparks
variables) names(dat.a)%in%names(dat.b) Could anyone help with this problem, I would basically like to form a subset of the dat.a that matches the variable names in dat.b. If there were only a few variables, this would be easier, but I have between 4 and 5 thousand variables in each datase

[R] Using gregexpr with multiple search elements

2009-02-25 Thread Corey Sparks
d. My problem is I need to check if either of two patterns match in the data, an example that doesn't work is gregexpr(c("\\at", "\\og"), text) which is the basic form of what I'm looking to do, if this would work I would get a match for elements 1 through 5 of

[R] svyglm fit method?

2008-12-18 Thread Corey Sparks
? Thanks for any insight. Best, Corey Corey Sparks Assistant Professor Department of Demography and Organization Studies University of Texas at San Antonio One UTSA Circle San Antonio, TX 78249 210 458 6858 corey.spa...@utsa.edu __ R-help@r-project.org mailing

[R] Help using tapply with multiple variables

2008-10-29 Thread Corey Sparks
e error: Error in tapply(popdat, dat2.sub$Country, pres.test, ... = list(N0 = popdat[, : arguments must have same length I see that the function mapply will take multiple arguements, but I don't think it will use an INDEX like tapply. Any comments or clarification would be most appreci

[R] Likelihood ratio test between glm and glmer fits

2008-07-16 Thread COREY SPARKS
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 outc

Re: [R] Use of survreg.distributions

2008-04-26 Thread COREY SPARKS
ning messages: >1: In log(dlist$dtrans(Y[exactsurv, 1])) : NaNs produced >2: In log(y) : NaNs produced then you have negative durations in the data. I would suggest truncating your data at y>0, as that would avoid taking natural logs of negative numbers. Corey Sparks Corey S.

Re: [R] Compare mean survival time

2008-02-20 Thread Corey Sparks
Xing Yuan wrote: > Dear List, > > Does anybody no how to compare mean survival times for two (more) groups in > R? What test statistics should I use? You should be careful considering the mean survival time, because censoring in survival data often makes the mean less informative. The median sur

Re: [R] Importing Large Dataset into Excel

2007-12-12 Thread Corey Sparks
Did you try read.xls() in the xlsReadWrite library, I have had good success with this. Corey Corey S. Sparks, Ph.D. Assistant Professor Department of Demography and Organization Studies University of Texas San Antonio One UTSA Circle San Antonio, TX 78249 email:[EMAIL PROTECTED] [[a

[R] coxme frailty model standard errors?

2007-12-05 Thread Corey Sparks
the community level variable with 4 levels. Does anyone know if there is a way to get the standard error for the random effect, like in nofit1$var? I would like to know if my random effect is worth writing home about. Any help would be most appreciated Corey Sparks I can get the following output nof

[R] coxme frailty model standard errors?

2007-12-05 Thread Corey Sparks
the community level variable with 4 levels. Does anyone know if there is a way to get the standard error for the random effect, like in nofit1$var? I would like to know if my random effect is worth writing home about. Any help would be most appreciated Corey Sparks I can get the following output nof

[R] Reading SAS SD2 Data file

2007-09-27 Thread Corey Sparks
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