Displaying 20 results from an estimated 30 matches for "ucbadmiss".
2012 Jan 26
1
ftable.formula
I apologize in advance if this is the wrong forum for this
report/request, and for the fact that I have not read the code for
ftable.formula in any detail.
>From reading the documentation for ftable.formula, I expected that the
following two calls to ftable would produce the same results:
data(UCBAdmissions)
ftable(UCBAdmissions, row.vars = "Dept", col.vars = c("Gender", "Admit"))
ftable(UCBAdmissions, Gender + Admit ~ Dept)
Is this a bug or the intended behavior? I prefer the formula interface,
so I would be happiest if the output was the same for the two calls.
Ho...
2010 Dec 02
1
latex tables for 3+ dimensional tables/arrays
...R method to produce latex versions of tables for
table/array objects of 3 or more dimensions,
which, of necessity is flattened to a 2D display, for example with
ftable(), or vcd::structable, as shown below.
I'd be happy to settle for a flexible solution for the 3D case.
> UCB <- aperm(UCBAdmissions, c(2, 1, 3))
> ftable(UCB)
Dept A B C D E F
Gender Admit
Male Admitted 512 353 120 138 53 22
Rejected 313 207 205 279 138 351
Female Admitted 89 17 202 131 94 24
Rejected 19 8 391 244 299 317
> structable(Dept ~...
2007 Feb 24
1
Woolf's test, Odds ratio, stratification
Just a general question concerning the woolf test (package vcd), when we have
stratified data (2x2 tables) and when the p.value of the woolf-test is
below 0.05 then we assume that there is a heterogeneity and a common odds
ratio cannot be computed?
Does this mean that we have to try to add more stratification variables
(stratify more) to make the woolf-test p.value insignificant?
Also in the
2007 May 05
1
How to latex tables?
Suppose I have a table constructed from structable or simply just an
object of class table. How can I convert it to a latex object? I looked
in RSiteSearch, but only found info about matrices or data frames.
Steve
For example, here is a table t2
> str(t2)
table [1:2, 1:2, 1:2] 6 8 594 592 57 ...
- attr(*, "dimnames")=List of 3
..$ Hospital : chr [1:2] "A"
2009 Oct 11
3
Error in family$family : $ operator is invalid for atomic vectors
Dear List,
I'm having problem with an exercise from The R book (M.J. Crawley) on page
567.
Here is the entire code upto the point where I get an error.
data(UCBAdmissions)
x <- aperm(UCBAdmissions, c(2, 1, 3))
names(dimnames(x)) <- c("Sex", "Admit?", "Department")
ftable(x)
fourfoldplot(x, margin = 2)
dept<-gl(6,4)
sex<-gl(2,1,24)
admit<-gl(2,2,24)
model1<-glm(as.vector(x) ~dept*sex*admit,poisson)
This last line r...
2006 Feb 14
1
addmargins
> addmargins(UCBAdmissions, FUN = list(Total=sum))
works with no problems, but consider:
> myFUN <- list(Total=sum)
> addmargins(UCBAdmissions, FUN = myFUN)
Error in "names<-.default"(`*tmp*`, value = "") :
names() applied to a non-vector
Is this a bug?
> R.version...
2008 Nov 20
1
About continuity correction option in the mantelhaen.test function.
Hello,
I was using the mantelhaen.test function (2x2 J tables for
conditional independence testing). I noticed that the option for the
continuity correction (correction=T or correction=F) sometimes made a
difference while sometimes it did give the same results regardless of
correction=T or correction=F.
Does the continuity correction apply only in certain cases or in
certain strata with some
2010 Dec 27
1
aperm() should retain class of input object
...equires some package writers to
implement both .array and .table
methods for the same functionality, usually one in terms of the other.
Some examples of unexpected, and initially perplexing results (when only
methods for one class are implemented)
are shown below.
> library(vcd)
> pairs(UCBAdmissions, shade=TRUE)
> UCB <- aperm(UCBAdmissions, c(2, 1, 3))
>
> # UCB is now an array, not a table
> pairs(UCB, shade=TRUE)
There were 50 or more warnings (use warnings() to see the first 50)
>
> # fix it, to get pairs.table
> class(UCB) <- "table"
> p...
2016 May 23
2
data frame method for as.table()
Hello,
Currently it's possible to convert an object of class table to a data frame
with as.data.frame.table(), but there's no ready-made function, AFAIK, to do
the reverse operation, i.e. conversion of a data frame to a table.
Do you think it would be a good idea to add a data.frame method to
as.table(), to allow such conversions?
The idea is that if `x' is a table and `y <-
2011 Feb 16
1
Saturated model in binomial glm
...makes sense if I fit the model using as response a vector of
proportions or a two-column matrix. But when the response is a factor
and counts are specified via the "weights" argument, I am kind of lost
as far as what is the implied saturated model.
Here is a simple example, based on the UCBAdmissions data.
> UCBAd <- as.data.frame(UCBAdmissions)
> UCBAd <- glm(Admit ~ Gender + Dept, family = binomial,
+ weights = Freq, data = UCBAd)
> UCBAd$deviance
[1] 5187.488
> UCBAd$df.residual
[1] 17
I can see that the data frame UCBAd has 24 rows and using 1...
2009 Feb 18
2
indicator or deviation contrasts in log-linear modelling
I am fairly new to log-linear modelling, so as opposed to trying to fit
modells, I am still trying to figure out how it actually works - hence I am
looking at the interpretation of parameters. Now it seems most people skip
this part and go directly to measuring model fit, so I am finding very few
references to actual parameters, and am of course clear on the fact that
their choice is irelevant for
2016 May 23
0
data frame method for as.table()
..."table" can be used to convert the array-based representation of a contingency table to a data frame containing the classifying factors and the corresponding entries (the latter as component named by responseName). This is the inverse of xtabs."
For example, from ?xtabs, using the ?UCBAdmissions dataset, which is a 3 dimension table:
> str(UCBAdmissions)
table [1:2, 1:2, 1:6] 512 313 89 19 353 207 17 8 120 205 ...
- attr(*, "dimnames")=List of 3
..$ Admit : chr [1:2] "Admitted" "Rejected"
..$ Gender: chr [1:2] "Male" "Female"...
2011 Mar 30
4
fonts in mosaic
I need to change the font(s) used in mosaic from package vcd.
The help file and the vignette do not give very explicit examples for
doing that.
The easiest solution would be changing the font for everything
on the graph: var labels, var names, title, subtitle, and cell labels.
What is the easiest way of accomplishing this?
2010 Jun 08
2
constructing a contingency table (ftable, table)
Dear all,
an hopefully quick table question.
I have the following data:
Two objects that are 2*9 matrix with nine column names (Dis1, ...,
Dis9) and the row names (2010,2020). The content are frequencies
(numeric).
In want to create a table that is along the lines of
ftable(UCBAdmissions) and should looks like this:
Dis1 | ...| Dis9
2010|2020|....|2010|2020
(first row,first column is the value of Dis1 in 2010 from first
object)| (first row,second column is the value of Dis1 in 2020 from
first object)| ....
(second row,first column is the value of Dis1 in 2010 from second
object...
2011 Apr 03
1
setCoefTemplate
Hi everyone,
I am trying to build a table putting standard errors horizontally. I
haven't been able to do it.
library(memisc)
berkeley <- aggregate(Table(Admit,Freq)~.,data=UCBAdmissions)
berk0 <- glm(cbind(Admitted,Rejected)~1,data=berkeley,family="binomial")
berk1 <-
glm(cbind(Admitted,Rejected)~Gender,data=berkeley,family="binomial")
berk2 <-
glm(cbind(Admitted,Rejected)~Gender+Dept,data=berkeley,family="binomial")
setCoefTemplate(e...
2011 Apr 03
1
style question
Hi everyone,
I am trying to build a table putting standard errors horizontally. I
haven't been able to do it.
library(memisc)
berkeley <- aggregate(Table(Admit,Freq)~.,data=UCBAdmissions)
berk0 <- glm(cbind(Admitted,Rejected)~1,data=berkeley,family="binomial")
berk1 <-
glm(cbind(Admitted,Rejected)~Gender,data=berkeley,family="binomial")
berk2 <-
glm(cbind(Admitted,Rejected)~Gender+Dept,data=berkeley,family="binomial")
setCoefTemplate(e...
2012 Aug 31
2
test Breslow-Day for svytable??
Hi all,
I want to know how to perform the test Breslow-Day test for homogeneity of
odds ratios (OR) stratified for svytable. This test is obtained with the following code:
epi.2by2 (dat = daty, method = "case.control" conf.level = 0.95,
units = 100, homogeneity = "breslow.day", verbose = TRUE)
where "daty" is the object type table svytable consider it, but
2002 Feb 26
1
Cross-tabulation of data from database
I am quite new to R, so please bear over with me if I have problems with the
R terminology.
I want to (try to) use R for some analyses within vegetation ecology, using
the vegan package. I have my data in a postgresql database, and I manage to
get them into R as a dataframe with columns for respectively: Name of the
analysed m2, Name of the species, coverage of species in the square in %. I
2005 Jan 10
4
Graphical table in R
I would like R to produce some tabulated data in a graphical output. When
I say tabulated data, what I mean is a table with rows and columns. This
would be useful when reading in a big file, performing some analysis on
it, and then wanting to display the results as a table.
Something like
plot(x,...)
where x is a matrix
For example, the result could look (approximatly) like...
2008 Jul 30
1
odds ratios in multiway tables (stratified)
Hi,
does anyone know of a function to calculate odds ratios in multiway
tables (stratified) (+ the other usual statistics involved)
i mean:
say we have a table r*c*d,
For every d (depth) we have a r*c table,
and in this table the odds ratio's are calculated for every 2*2 subtable
in it.
logically this function would look like):
ORs(multiwaytable)
or
ORs(data$var1r,data$var2c,data$var3d)