Displaying 20 results from an estimated 2000 matches similar to: "Calculateing means"
2009 Aug 25
4
table, xyplot, names, & loops
Hi R community,
I'm just starting out in R and have a basic question about xyplot and
tables. Suppose I had a table of data with the following names: Height,
Age_group, City. I'd like to plot mean Height vs Age_group for each City.
When I try to do the following:
> library(lattice)
> xyplot(mean(Height) ~ Age_group | City)
of course I get just one data point, the mean Height for
2007 Oct 07
2
Re-ordering factors
A small example before I begin my query:
> educ <- read.table(efile, header=TRUE)
> educ
Education Age_Group Count
1 IncompleteHS 25-34 5416
2 IncompleteHS 35-44 5030
3 IncompleteHS 45-54 5777
4 IncompleteHS 55-64 7606
5 IncompleteHS >64 13746
6 CompletedHS 25-34 16431
7 CompletedHS 35-44 1855
8 CompletedHS 45-54 9435
9
2008 Mar 12
1
ftable and xtabs
Hoping someone can help me with xtabs and ftable. I'm trying to get a pair
of ftables (possibly more) next to each other. For example:
> dunhill_lights_xtab<-ftable(xtabs(grossedupobs ~ gender+age_group +
dunhill_lights, data = ciggs))
> dunhill_lights_xtab
dunhill_lights No Yes
gender age_group
Female
2009 May 11
3
Intermittently Get "Target filesystem does not support long file names" when copying file to Samba share
I have two CentOS servers running samba3-3.0.34-37. When I connect to a
samba share from my Windows 2003 R2 servers, and then try to copy a file
to it, I often get the message "target filesystem does not support long
filenames." Sometimes it works and sometimes it doesn't. I've been
fighting this problem for 2 years. I've replaced my Windows servers,
changed my Windows
2003 Dec 06
2
Difference between summary.lm() and summary.aov()
I have a simple linear model (fitted with lm()) with 2
independant
variables : one categorical and one integer.
When I run summary.lm() on this model, I get a
standard linear
regression summary (in which one categorical variable
has to be
converted into many indicator variables) which looks
like :
Estimate Std. Error t value Pr(>|t|)
(Intercept) -3595.3 2767.1 -1.299
2012 Dec 14
1
format.pval () and printCoefmat ()
Hi List,
My goal is to force R not to print in scientific notation in the sixth column (rel_diff - for the p-value) of my data frame (not a matrix).
I have used the format.pval () and printCoefmat () functions on the data frame. The R script is appended below.
This issue is that use of the format.pval () and printCoefmat () functions on the data frame gives me the desired results, but coerces
2006 Jun 05
1
Selective Survival Statistics with R
Hello friends and fellow R users,
I have a problem to which I have been unable to find a solution: I am
gathering survival data on patients undergoing treatment with a new kind
of stent. I want to generate survival data and plot survival curves of
these patients based (among other things) on the treating physician. My
data set has been tabulated in the following manner:
Date (the date the stent
2006 Jul 22
1
Input on application design
I have an online doctor/dentist search. Right now I have all the code
in one controller, with separate views and actions for the doctor and
dentist. About 80% of the code in both the controller and the view is
shared. Doctors and dentists are in separate tables with different
(yet very similiar) schema''s. So the sql queries are different, and
some of the information displayed in the
2011 Feb 28
2
What if my Windows AD Domain Controller Goes Down?
There are three DCs in my Windows 2003 AD domain, but I have noticed
that only one of them is referenced in my krb.conf and krb5.conf. Should
there be a reference to one or two of the other domain controllers? If
the DC goes down, how will my Samba/Winbind servers authenticate?
--
Eric Robinson
Disclaimer - February 27, 2011
This email and any files
2006 Mar 31
2
Backslash Escaping in View
Ok, I''m hoping this won''t be a forehead slapper, but take a look at this code:
physician.name.sub(/''/, "\\''")
I''m trying to substitute a single quote with a backslash and a single
quote. This seems pretty simple right? Well, someone kick me and
tell me why it''s not :)
Here''s what I''m getting if the
2009 Oct 19
3
loop and plot
Dear all,
I am stuck at applying loop function for creating separated plots.
I have coding like below:
dataset.table <-
table(data.frame(var1=c(1,2,3,1,2,3,1),colour=c("a","b","c","c","a","b","b")
))
kk = function(f)
{
ls=as.character(f)
pie(dataset.table[ls,],main=ls)
2009 Jun 23
2
Long to wide format without time variable
Hi all,
I am trying to convert a data set of physician death codings (each individual's cause of death is coded by multiple physicians) from long to wide format, but the "reshape" function doesn't seem to work because it requires a "time" variable to identify the sequence among the repeated observations within individuals. My data set has no order, and different
2007 Nov 30
1
meta-analysis on diagnostic tests (bivariate approach)
Hello friends of R list,
Im a physician and Im not that good in statistics. I have posted similar
email in the epi-sig list but no one aswered so far. Im cunducting a
systematic review on two diagnostic test for a particular tropical disease.
I found a free software that make most of the analysis called MetaDiSc.
However there is a paticular analysis that I wuould like to try that it is
not
2010 Aug 13
2
How to compare the effect of a variable across regression models?
Hello,
I would like, if it is possible, to compare the effect of a variable across
regression models. I have looked around but I haven't found anything. Maybe
someone could help? Here is the problem:
I am studying the effect of a variable (age) on an outcome (local recurrence:
lr). I have built 3 models:
- model 1: lr ~ age y = \beta_(a1).age
- model 2: lr ~ age + presentation
2004 Apr 14
1
Variable Descriptors
Is there a way to associate text descriptions with variables in a
data.frame?
For example...
Let's say that in my data.frame I have a variable named var1. var1
represents the responses to the question "When was the last time you saw
your physician?" When I tabulate the variable var1 I'd like the output to
be a bit more descriptive and contain the more descriptive
2011 May 11
1
filtering out unwanted words in a Term Document Matrix
Hi Y'all,
I am using the text mining package (tm). I am trying to filter out all of the words in a Term Document Matrix that are not in a list of words that I am interested in. I am using the following code:
z<-tm_intersect(txt.dtm, c("communications", "safety", "climate", "blood", "surface", "cleanliness",
2006 Jun 10
1
Calculating survival for set time intervals
Hello friends and fellow R users,
I have successfully tabulated and entered my survival data into R and
have generated survival curves. But I would like to be able to determine
what the survival rates are now at one month, three months, six months
and one year.
I have a data set, via.wall, which I have entered into R, and which
generates the following Surv object:
Surv(Days,Status==1)
[1]
2011 Mar 11
5
How to calculate means for multiple variables in samples with different sizes
Hello R-helpers:
I have data like this:
sample replicate height weight age
A 1.00 12.0 0.64 6.00
A 2.00 12.2 0.38 6.00
A 3.00 12.4 0.49 6.00
B 1.00 12.7 0.65 4.00
B 2.00 12.8 0.78 5.00
C 1.00 11.9 0.45 6.00
C 2.00 11.84 0.44 2.00
C 3.00 11.43 0.32 3.00
C 4.00 10.24 0.84 4.00
D
2006 Jul 21
1
validates_acceptance_of weirdness
On my registration form I have a checkbox for a waiver. In the model I
have the statement:
validates_acceptance_of :waiver, :on => :create, :message => "must be
accepted"
In the view:
<%= check_box_tag("waiver") %>
<%= error_message_on "user", "waiver", "Waiver "%>
For some reason validate is accepting everything when the
2008 Jan 16
1
Probability weights with density estimation
I am a physician examining an NHANES dataset available at the NCHS
website:
http://www.cdc.gov/nchs/about/major/nhanes/nhanes2005-2006/demo_d.xpt
http://www.cdc.gov/nchs/about/major/nhanes/nhanes2005-2006/hdl_d.xpt
http://www.cdc.gov/nchs/about/major/nhanes/nhanes2005-2006/tchol_d.xpt
Thank you to the R authors and the foreign package authors in
particular. Importing from the SAS export