Displaying 20 results from an estimated 400 matches similar to: "multiple 2 by 2 crosstabulations?"
2012 Jun 28
4
Printing a variable in a loop
Dear R Users:
I'm a STATA user converting to R, and I'd like to be to do the following.
#Assign var_1 and var_2 a value
10->var1
20->var2
#Now I'd like to print the values of var_1 and var_2 by looping through
var_1 and var_2 in such a manner:
while(y<3){
print(var_y)
y+1->y
}
In STATA, the "y" appended to " var_" is called the local variable and
2008 Apr 15
1
glm syntax question
Hello,
I'm new to R and have a very basic syntax question for the
functionglm. I am using the function glm() to do a regression on a
data set. I want to run this function in a while loop, so I need to be
able to do two things:
(1) I need to be able to have my list of variables in the regression
be based from a variable vector instead of hard code.
(2) I need to be able to collect the
2018 Oct 16
2
Comprobar los nombres de columnas entre varios dataframes
Buenas tardes,
Quiero aplicar la función rbind y necesito tener los mismos nombres de
columnas. Como tengo unas 195 variables en cada dataframe, necesito
hacerlo de una forma rápida. Tengo 9 bases de datos y tengo que fusionar
todas. ¿Como puedo comprobar que los nombres de las variables son los
mismos? Y de lo contrario, ¿como detecto las diferencias?
He probado con
2013 May 15
4
series financieras
Buenos dias,
Tengo la siguiente duda.
Desde una hoja de calculo .xls me descargo un fichero en r as.matrix.
Time VAR_2 VAR_3 VAR_4........ VAR_N
Fechas(n) Precios Precios Precios Precios
Fechas (n-1)
¿como puedo hacer para graficar de forma ordenada (fechas) cada uno del vector columnas (son precios de activos)?
[[alternative HTML
2011 Jan 20
2
Accessing a 'user' variable via. dialplan.
Hi,
I know you can access various sip variables via
'Set(sstatus=${SIPPEER(201,status)})' (for example) to get the status of
the sip user - but what about variables?
I have a user that has setvar=123456 in their users.conf (sip.conf if
you prefer). I can read it with a 'sip show peer 201' - but that gives
everything and parsing that isn't really an option.
Anyone know how
2010 Nov 13
2
interpretation of coefficients in survreg AND obtaining the hazard function for an individual given a set of predictors
Dear R help list,
I am modeling some survival data with coxph and survreg (dist='weibull') using
package survival. I have 2 problems:
1) I do not understand how to interpret the regression coefficients in the
survreg output and it is not clear, for me, from ?survreg.objects how to.
Here is an example of the codes that points out my problem:
- data is stc1
- the factor is dichotomous
2010 Nov 15
1
interpretation of coefficients in survreg AND obtaining the hazard function
1. The weibull is the only distribution that can be written in both a
proportional hazazrds for and an accelerated failure time form. Survreg
uses the latter.
In an ACF model, we model the time to failure. Positive coefficients
are good (longer time to death).
In a PH model, we model the death rate. Positive coefficients are
bad (higher death rate).
You are not the first to be confused
2010 Nov 16
1
Re : interpretation of coefficients in survreg AND obtaining the hazard function for an individual given a set of predictors
Thanks for sharing the questions and responses!
Is it possible to appreciate how much the coefficients matter in one
or the other model?
Say, using Biau's example, using coxph, as.factor(grade2 ==
"high")TRUE gives hazard ratio 1.27 (rounded).
As clinician I can grasp this HR as 27% relative increase. I can
relate with other published results.
With survreg the Weibull model gives a
2006 May 02
1
Is there a bug in CrossTable (gmodels)
Library gmodels include a function CrossTable that is useful for
crosstabulation. In the help, it is indicated that one can call this
function as CrossTable(data), were data is a matrix. However, when I try
to use this option, it doesn't help. Any idea? Is there a bug?
Thanks for your help.
Prof. Albert Sorribas
Grup de Biomatem?tica i Bioestad?stica
Departament de Ci?ncies M?diques B?siques
2006 Dec 03
2
Force "square" crosstabulation
Hello list members,
I'm looking for a way to force the results of a crosstabulation to be
square - that is, to include 0 values.
For example:
table(letters[1:4],letters[c(1:3,3)])
yields:
a b c
a 1 0 0
b 0 1 0
c 0 0 1
d 0 0 1
I would like to return:
a b c d
a 1 0 0 0
b 0 1 0 0
c 0 0 1 0
d 0 0 1 0
Any suggestions?
Thanks!
--
Manuel A. Morales
2008 Sep 23
1
Generalising to n-dimensions
Hi R-helpers,
I have two queries relating to generalising to n dimensions:
What I want to do in the first one is generalise the following statement:
expand<-expand.grid(1:x[1],1:x[2],...1:x[n]) where x is a vector of integers
and expand.grid gives every combination of the set of numbers, so for
example, expand.grid(1:2, 1:3) takes 1,2 and 1,2,3 and gives 1,1 2,1
1,2 2,2 1,3 2,3
My x
2011 Mar 04
2
Creating a .png with just an expression() in it
Hey,
I'm trying to create an image file with the results of a regression
analysis. In TeX, the line would be something like:
$ size = 0.34 + 4.3 var_1 $
Can I create a plot window with just this line in it? I tried playing
around with plot.new() or dev.new(), but didn't really find something
that worked.
Thanks in advance,
Alex
--
alexx at alexx-fett:~$ vi .emacs
2008 Nov 13
2
CROSSTABULATION
I want to form a 3x3 crosstabulation for the signs of two vectors (i.e.
Negative, Zero, Positive). The problem is that I am simulating the data so
for some iterations one of the categories is absent. Thus the resulting
table shrinks to 3x2. I want it to be 3x3 with zero column corresponding to
the missing category. Moreover, I have tried but failed to give the
dimension names.
--
Sohail Chand
2009 Oct 12
1
crosstabulation and unlist function
Hello R-users,
My toy example:
aa<-c(1:5)
bb<-c(NA,2,NA,4,5)
cc<-c(1,2,NA,4,NA)
dd<-c("A","B","B","A","C")
df<-data.frame(aa,bb,cc,dd=as.factor(dd))
table(unlist(df[,1:3]))
Can anyone point me to what function let's me do a crosstabulation between table(unlist(df[,1:3])) and df$dd?
I want to find out when dd==A (or B,
2000 Sep 24
2
FW: Crosstabulation
how about this: tapply(vector,list(factor1,factor2),function)?
-----Original Message-----
From: owner-r-help at stat.math.ethz.ch
[mailto:owner-r-help at stat.math.ethz.ch]On Behalf Of Murray Jorgensen
Sent: 24. september 2000 02:46
To: R-help
Subject: [R] Crosstabulation
I can't seem to find a function in R similar to Splus crosstabs() for
creating a multi-way table from factors and a
2002 Jul 12
2
Crosstabs in R
Before I reinvent the wheel, I have need for a relatively straightforward
crosstabulation (2 x n) function. I know that R has table(), ftable(),
xtabs(), and summary(xtabs()), but none of these produce a fully "tricked"
out cross-tabulation with marginal totals, expected cell frequencies, and
an array of statistics about the contingency table.
Is there a more complete (something
2003 Aug 22
2
"subscript out of range" message
Hi All:
I was recently working with a dataset on arsenic poisoning. Among the
variables in the dataset, I used the following three variables to produce
crosstabulations (variable names: FOLSTAT, GENDER, ASBIN; all three were
categorical variables, FOLSTAT denoted follow up status for the subjects and
had seven levels, GENDER denoted sex (two levels: male,female), and ASBIN
denoted binarized
2006 Apr 26
3
Were to find appropriate functions for a given task in R
This is a generic request concerning were to look for finding
appropriate information on a precise procedure in R.
I’m using R for teaching introductory statistics and my students are
learning how to deal with it. However, I find it difficult to locate
some of the procedures. For instance, for basic crosstabulation, it is
obvious that basic functions as table, ftable, and prop.table can be
used.
2008 Feb 15
12
Transfer Crosstable to Word-Document
# Dear list,
# I am an R-beginner and
# spent the last days looking for a method to insert tables produced
# with R into a word document. I thought about SPPS: copy a table from
# an SPO-file and paste it into a word document
# (if needed do some formatting with that table).
# Annother idea was, to produce a TEX-file,
# insert it and make it a word-table.
# I found the following libraries, which
2003 May 17
1
how to handle 'multiresponse' variable?
Hello!
I have dataset where one variable is 'multiresponse', like this:
[1] "1 2" "1 2 3" "4" "1 4" "4 3" etc.
'responses' separated by space. observations in different 'rows'
of data.frame.
I can do strsplit(data$var,' ') and make a list, where multiple
responses are elements of character vectors, like this:
$