similar to: Using Weights in R

Displaying 20 results from an estimated 200 matches similar to: "Using Weights in R"

2012 Aug 10
1
Direct Method Age-Adjustment to Complex Survey Data
Hi everyone, my apologies in advance if I'm overlooking something simple in this question. I am trying to use R's survey package to make a direct method age-adjustment to some complex survey data. I have played with postStratify, calibrate, rake, and simply multiplying the base weights by the correct proportions - nothing seems to hit the published numbers on the nose. I am trying to
2009 Apr 24
3
Help with for/if loop
I have a set of data that includes various data columns. One if the survival time and another if a continuous variable of ages. I want to put the ages into intervals so that I can then perform the Kalpan Meier test. I am trying to use the following code to build a column with the age group numbers in agecatagory<-c( ) for (i in 1:137) { { if(age[i]<=46) {agecat[i]<-1} if(age[i]>46
2011 Jan 03
3
Inverse Gaussian Distribution
Dear, I want to fit an inverse gaussion distribution to a data set. The predictor variables are gender, area and agecategory. For each of these variables I've defined a baseline e.g. #agecat: baseline is 3 data<-transform(data, agecat=C(factor(agecat,ordered=TRUE), contr.treatment(n=6,base=3))) The variable 'area' goes from A to F (6 areas: A,B,C,D,E,F) How can i
2009 Dec 30
1
glm error: cannot correct step size
R 2.8.1 windows XP I am getting an error message that I don't understand when I try to run GLM. The error only occurs when I have all independent variables in the model. When I drop one independent variable, the model runs fine. Can anyone help me understand what the error means and how I can correct it? Thank you, John > fit11<-glm(AAMTCARE~BMI+BMIsq+SEX+jPHI+jMEDICAID+factor(AgeCat)+
2012 Apr 03
1
Compare by row and insert previous row value (Or non Time Series Lag)
I have the following sample dataset (CSV input here:http://goo.gl/YR8LP. CSV output here: http://goo.gl/EFCC8) which I want to transform as follows. For each person in a household I want to create two new variables OrigTAZ and DestTAZ. It should take the value in TripendTAZ and put that in DestTAZ. For OrigTAZ it should put value of TripendTAZ from the previous row. For the first trip of every
2003 Jun 26
1
xyplot
I am doing group wise plots by using the following commands; it shows errors that I do not know how to fix it. Please help. xyplot(within.2.special.care ~ agecat| mco.cms.ind, neuro, panel = function(x,y){ + panel.grid() + panel.xyplot(x,y) + panel.loess(x,y, span =1)}) Error: couldn't find function "xyplot" [[alternative HTML version deleted]]
2009 Aug 14
1
post hoc test after lme
Hi! I am quiet new with R and I have some problems to perform a posthoc test with an lme model. My model is the following: >lme1<-lme(eexp~meal+time, random=~1|id,na.action=na.omit) and then i try to get a post hoc test: >summary(glht(lme1,linfct=mcp(meal="Tukey))) but I get a warning message: Erreur dans as.vector(x, mode) : argument 'mode' incorrect Thank you for your
2011 Feb 19
1
Conditional recoding
I am trying to recode a variable into another variable and while the package 'car' works well when it is only recoding A into B, I am not sure I can do the same with recoding (A or C) into B. If i can use recode please advise on how to. So i am using an if/else if conditions. My sample dataset is below along with the code and the warning and results i get. TIA Krishnan #****Code****
2008 Jan 05
2
Behavior of ordered factors in glm
I have a variable which is roughly age categories in decades. In the original data, it came in coded: > str(xxx) 'data.frame': 58271 obs. of 29 variables: $ issuecat : Factor w/ 5 levels "0 - 39","40 - 49",..: 1 1 1 1... snip I then defined issuecat as ordered: > xxx$issuecat<-as.ordered(xxx$issuecat) When I include issuecat in a glm model, the result
2008 Jun 13
0
Help with stat.table in Epi package,
R Fans-- I am having problems with the following code. It worked under R 2.6.0 but not in 2.7.0. > library(Epi) > df <- read.table( "c:/Documents and Settings/Troy S/My Documents/debug_chisq_080613b.txt") > summary(df) cvd agecat Min. :0.0000 (0,40] :1 1st Qu.:0.0000 (40,60]:2 Median :0.0000 Mean :0.3333 3rd
2011 Aug 10
1
igraph - designing graph plot by attributes
Hi, I'm working on some social networks and I managed to create the graphs with labels and edges weight, but I would also like to change the size of the vertices according to the age of the persons in the network and the shape according to the gender. Now for the age, I have people with ages between 20 and 78, and I would like to have 4 categories (sizes): 20-35, 36-50, 50-65, >65. I have
2013 Feb 15
0
Ho w Do I Get Cox Model Convergence After Multiple Imputation
Due to missing data with some of my predictor variables I first do multiple imputation as follows: library(foreign) library(Amelia) library(norm) set.seed(666) M=10 impdat <-
2010 Mar 13
3
(no subject)
Dear Colleagues, We are attempting to create trees using R with our Ruby on Rails application. However, we are running into a problem involving the creation of the graphic. We would like them to be in either jpg or png format so that users can save, but due to a lack of control over our sever we are unable to start X11 server. Is there a way to create these images without using X11 server?
2013 Apr 11
2
Accessing libvirtd from multiple agents
Hi, I was wondering if multiple remote agents can access the same libvirtd. How do we prevent conflicting commands from the different agents. Can different access permission be set for the agents? (The documentation usually goes over the case where one agent can access multiple libvirtd and not this case) Thanks Arvind -------------- next part -------------- An HTML attachment was scrubbed... URL:
2013 May 15
2
Designing libvirt client
Hi, I have a VMM application using a homegrown client for communicating with hypervisor. I am planning to migrate to libvirt because of the blocking nature of the calls. After going over the architecture, I would like to have a few doubts clarified 1) Should my application be necessarily multi-threaded in order to make use of the non-blocking calls in libvirt. [Are overlapping methods mainly used
2009 Aug 31
2
How to extract the theta values from coxph frailty models
Hello, I am working on the frailty model using coxph functions. I am running some simulations and want to store the variance of frailty (theta) values from each simulation result. Can anyone help me how to extract the theta values from the results. I appreciate any help. Thanks Shankar Viswanathan
2008 Jul 02
2
Reading CSV file with unequal record length
Hello , I am having some difficulty reading a CSV file of unequal record length in R . The data has 26 columns and do not have header and is generated from a R syntax - write.table(schat,"schat.csv", sep=",", col.names=FALSE, append = TRUE) 1.0,1.0,0.0,0.1,0.1,0.1,0.2,0.2,0.3,0.3,0.4,0.4,0.5,0.6,0.7,0.8,0.9,1.0,1.2,1.5,1.9,2.7,,,,
2012 Dec 20
3
Whats the best approach to create a repo of the installers to be used for installing and upgrading in the puppet managed nodes
Lets take the example, I am having a jboss-4.2.3 installers as a .tar file. In general to install jboss, i ll 1. untar the jboss-4.2.3 into a prefefined folder (opt/server/jbossas/) into multiple servers 2. untar the openjdk into a preferined path (/opt/software/java)set the path in the bash.profile 3. Create server profile in the place where jboss is installed 4. Start the server. Lets say
2013 Jun 14
1
How to interactively create manually guided Decision Tree
I am new in using R. I want to know all about building decision tree model in R. Few options which I searched are rpart and rattle to build a decision tree.Both the functions are giving me splits which are statistically appropriate. But I am not able to figure out how to change those splits as per my business requirement. for example : the automatic split of Age by using rattle is > 30 and
2005 Dec 26
1
grouping-R-help
Hello R-experts, I have a set of data as follows: age time 1 28 1 2 53 2 3 53 3 4 36 4 5 54 4 6 46 4 7 45 5 8 31 6 9 53 7 10 35 7 11 62 8 12 19 8 13 43 2 14 51 3 15 45 0 16 48 2 17 49 3 18 57 2 19 45 3 20 27 10 21 33 12 22 29 14 23 46 16 24 45 19 25 43 2 26 28 6 27 50 7 28 28 4