[R] correct standard errors (heteroskedasticity) using survey design

2012-04-15 Thread jour4life
Hello all, I'm hoping someone can help clarify how the survey design method works in R. I currently have a data set that utilized a complex survey design. The only thing is that only the weight is provided. Thus, I constructed my survey design as: svdes-svydesign(id=~1, weights=~weightvar,

Re: [R] Problem Removing Border Lines in Maps Package

2012-02-25 Thread jour4life
I'm sorry to ask this silly question so long after you posted this response. But I have also been trying to do this. What is the option to draw the outlines the same color as the fill? I'm also using the spdep and maptools libraries. I have shapefiles for Mexico (counties and read in the spatial

Re: [R] identify duplicate from more than one column

2011-11-13 Thread jour4life
Thanks Jim and David! It seems like both were great options. Both of your suggestions of pasting both IDs together worked well, keeping the pasting as a character is better. Though, Jim's example was interesting, it gave me the following error: Error in `$-.data.frame`(`*tmp*`, coupleid, value =

Re: [R] identify duplicate from more than one column

2011-11-13 Thread jour4life
Hi Josh, I'm sorry, it was meant for you. I guess for now that error doesn't matter...for now. Essentially, I want to repeat the conditions that state the following, and continue doing so for several variables. At the end of the day, I'm only going to keep the couple ID and remove the

Re: [R] identify duplicate from more than one column

2011-11-13 Thread jour4life
Hi William, This worked like a charm! I was thinking about using reshape(), but was unsure on how to approach it. Though I have a whole lot of variables, I decided to keep only those variables that contained both sexes' characteristics, reshape it into wide format, and merge with the rest of the

[R] identify duplicate from more than one column

2011-11-12 Thread jour4life
Hi all, I've searched everywhere to try to find out how to do this and have had no luck. I am trying to construct identifiers for couples in a dataset. Essentially, I want to identify couples using more than one column as identifiers. Take for instance: obs unithome z

[R] looping by grouping variable

2011-08-31 Thread jour4life
Hello all, I hope something is not already posted regarding this exact problem I am trying to solve. I've read through the forums and previous postings and am still confused as to how to approach this. Basically, what I am trying to do is construct variables that utilizes an average of a variable

[R] create multiple variables loop

2011-07-17 Thread jour4life
Hello all, I am trying to figure out how to construct several new variables without having to write a code for each one. Specifically, I want to calculate ratios for several variables. For instance, let's say I have: df male1990 male1995 male2000 male2005 female1990 female1995 female2000

Re: [R] change value in one cell

2011-06-11 Thread jour4life
Z 1 1 1 0 1 2 2 0 0 1 3 3 1 1 1 4 4 0 1 1 5 5 1 1 0 6 6 0 0 0 x[4, Y] - 0 x Obs X Y Z 1 1 1 0 1 2 2 0 0 1 3 3 1 1 1 4 4 0 0 1 5 5 1 1 0 6 6 0 0 0 On Fri, Jun 10, 2011 at 5:42 PM, jour4life [hidden email] /user/SendEmail.jtp?type=nodenode=3589793i=0

[R] change value in one cell

2011-06-10 Thread jour4life
Hello all, I am wondering if there is a way to change the value of one cell in R. For instance let's say I have a hypothetical data frame that looks like this: Obs X Y Z 11 0 1 20 0 1 31 1 1 40 1 1 51 1 0 60 0 0 I would like to change the value of the 4th observation in

Re: [R] sample weights in ols

2011-05-11 Thread jour4life
I have a follow up question. When using svyglm, it does not matter that I am not using survey design and only weights? In other words, fit-svyglm(y~x1+x2+...xk,data=dataset,weights=weightvariable) Or am I going to have to construct a survey design variable, using only the weight variable?

Re: [R] sample weights in ols

2011-05-11 Thread jour4life
Thanks so much. I really appreciate it. Carlos On 5/11/2011 3:18 PM, Thomas Lumley-2 [via R] wrote: On Thu, May 12, 2011 at 2:43 AM, jour4life [hidden email] /user/SendEmail.jtp?type=nodenode=3515742i=0 wrote: I have a follow up question. When using svyglm, it does not matter that I am

[R] sample weights in ols

2011-05-10 Thread jour4life
Hello all, I am wondering if there is a way to specify sampling weights for an ols model using sample weights. For instance, right now, my code is: fit.ex-lm(y~x1+x2+x3+...xk,data=dataset,weights=weightvariable.) summary(fit.ex) But, there is almost no difference in the coefficients nor

Re: [R] sample weights in ols

2011-05-10 Thread jour4life
On 5/10/2011 3:12 PM, Thomas Lumley-2 [via R] wrote: On Tue, May 10, 2011 at 2:50 PM, jour4life [hidden email] /user/SendEmail.jtp?type=nodenode=3512894i=0by-user=t wrote: Hello all, I am wondering if there is a way to specify sampling weights for an ols model using sample weights