Displaying 11 results from an estimated 11 matches for "agegroup".
Did you mean:
age_group
2007 Oct 05
0
discrepancy in the result of R and SAS on same data in logistics regression
...etings!
I have come across a discrepancy shown by R and SAS results on same data for logistics regression..
When I processed the above csv file(1000.csv) for predicting the Action (i/c) by Age Group(1-7,Na) and Gender(M,F,Na) with GLM of R I get:
R result
Call:
glm(formula = Action ~ Gender + AgeGroup, family = binomial,
data = mydata1, na.action = na.pass)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.828 -0.973 -0.709 1.087 1.734
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 1.2939 0.3180 4.069 4.73e-05 ***
GenderM...
2008 Aug 21
1
replacing missing values in a dataframe with reference values.
...o do this but I'm having a mental block this
evening. Essentially, I'm trying to replace missing data in my dataset
with reference values based on age and sex.
So an example dataset is
set.seed(1)
X = data.frame(age=rnorm(10, 50, 10), sex=rbinom(10, 1, 0.5),
A=rnorm(10), B=rnorm(10))
X$agegroup = cut(X$age, breaks=c(20, 30, 40, 50, 60, 70, 80), labels =
c("20-29", "30-39", "40-49", "50-59", "60-69", "70-79"))
# make some missing
X$A[c(1, 5, 6)]=NA
X$B[c(2, 3, 8)]=NA
and my reference dataset is
refval = data.frame(agegroup = re...
2004 Jan 30
1
Trouble plotting with factor
With R 1.8.1 running in Fedora Core 1 Linux, I am having some trouble
recoding and ploting some factor variables.
First, can I give you some example data?
Here is a column of names for age groups:
agegroups <- c( "15-19", "20-24", "25-29","30-34", "35-39",
"40-44","45-49","50-54","55-59","60-64", "65-69", "70-74", "75-79",
"80-84", "OVER")
Her...
2008 Oct 28
1
lattice: overlap histogram
Dear R users,
Is it possible to have an overlap histogram plot? For example:
stuff <- data.frame(Mode = c("Land", "Air"), AgeGroup = c("Young", "Adult",
"Old"), Value = sample(1:300))
histogram( ~Value | AgeGroup * Mode, data = stuff, auto.key = TRUE)
Instead of having 2 * 3 panel, I want to have just 3 panel, overlapping the
"Mode" into the same panel.
I tried the following:
histogram...
2008 Apr 07
2
Naming rows oe columns in a data frame.
Hello there! I have a really basic question. I have extracted some data from a big database. I have ordered the data in to different agegroups in the rows. Now I want to to have labels of the columns which is going to be divided into men , women and totals. How do I give names to a column? My data looks like this for the moment;
0-39 12 34 43
40-49 14 23 23
50-59 16 37 21
60-69 75 32 41
etc...
2012 Jan 19
2
Reading in tab (and space) delimited data within a script XXXX
...ring),
header=TRUE, sep=",",
row.names="id", na.strings=" ")
closeAllConnections()
mydata
Can anyone suggest a similar approach for reading in tab-delimited or
single space delimited data? Example data:
data3<-
"OBSNO AGE SEX ALKPHOS LAB CAMMOL PHOSMMOL AGEGROUP
21 76 M 84 5 3.2 0.9 3
22 76 M 5 2.18 0.84 3
23 68 M 82 5 2.15 0.52 1
24 69 M 84 5 2.3 1.36 1
25 76 F 100 3 25.3 1.07 3
26 70 F 90 3 20 0.97 2
27 71 F 109 3 22.3 0.94 2
28 70 -99 65 3 24.3 1.42 2
29 74 F 61 3 25 0.87 2
30 74 F 62 3 23.3 0.94 2"
Thanks!
Dan
[[alternative HTML version delet...
2013 Mar 23
1
Non-convergence error for GLMM with LME4?
...ight indicate which predictor variable was the problem...). However, even when using a single fixed effect variable (just sex, for instance), I continue to have the problem, which makes me think the issue may be with my random effect. Here is the model I would like to run:
mm1=lmer(BinomialOutcome~AgeGroup+Sex+Study.Site+(1|BearID.reformatted),family=binomial)
The study is based on bear captures over a period of time, such that some bears are captured only once, while others many times (in a very unbalanced fashion); I would like to use all the data, but want to account for resampling of specific ind...
2007 Apr 09
1
Repeated Measures design using lme
...nts
Response measure: Blood pressure
Fixed Factor: 4 Age groups
Fixed Factor: Drug vs. NoDrug
Random factor: Day of the read (i.e. 6 replicate reads (R1-R6) at the baseline time, and 6 replicate reads (R1-R6) after the drug has had time to take effect)
Random Factor: Subjects 1-16
Patient AgeGroup BP(Blood Pressure) Read (replicate reads) Pre/PostTreatmentWeek Group
1 20-29 83 R1 pre Treat
2 20-29 81 R1...
2008 Apr 27
1
Adding rownames with different lengths to a table
Hello! I would like to add names to a table. The table presents median values, numbers of values (n) and percentage(%) for a given agegroup. Thus I would like to add a label above these three variables for each category. But if I try to use colnames I get a message telling me that the number of labels must be equal to the number of columns in the table. I hope someone could understand what I mean!
[[alternative HTML version deleted]]
2008 Jul 28
1
Negative Binomial Regression
Hello.
I am attempting to duplicate a negative binomial regression in R. SAS uses
generalized estimating equations for model fitting in the GENMOD procedure.
proc genmod data=mydata (where=(gender='F'));
by agegroup;
class id gender type;
model count = var1 var2 var3 /dist=NB link=log offset=lregtm;
repeated subject=id /type=exch;
run;
Since my dataset has several observations for each subject, I need the
REPEATED statement in order to indicate dependence among observations with
the same subject ID and inde...
2012 May 22
2
getting a Likert plot from a data frame
...does exactly what I'm trying to achieve. here the two population counts are plotted in the likert plot and the age groups in the first columns are used as labels.
I can't work out why in my example the age group variable is not used in the same way as the in my plot in the same way as the agegroups in this example, other than the example takes it's data from a table and mine is coming from a data frame. The end point I want is a stacked Likert bar chart based on a data frame where the column containing the description of my groups is used as the y axis labels and the other two columns a...