you very much for your help!
Serguei Kaniovski
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self
Dear List,
I am looking for what B.S.Everitt refers to as Cochrane Method for testing
independence in combined 2x2 contingency tables. Is it the same method as
the Cochran-Mantel-Haenszel Chi-Squared Test for Count Data in R?
Thanks,
Serguei
[[alternative HTML version deleted]]
Hello,
I would like to inlude the Q-Q plot by qqmath into a panel with other
plots, say, using par(mfrow=c(1,2)). How can this be done given that
qqmath refreshes the plotting window and there seems to be no series
coming out of it?
Thanks
Serguei
[[alternative HTML version deleted]]
Hello everyone,
I am confused about how the dependent variable should be specified, e.g.
say S and F denote series of successes and failures. Is it
share-S/(S+F)
glm(share~x,family=quasibinomial)
or
glm(cbind(S,F)~x,family=quasibinomial)
The two variants produce very different dispersion
Hello,
a have two matrices of data as below. I would like to add-up the duplicate
in terms of pair of names in rows, and then merge the values in the second
matrix to the pairs as two new variables x3 and x4.
Input
,x1,x2
jane.mike,31,43
jane.steve,32,2
jane.steve,5,3
jim.mike,76,5
___
Austrian Institute of Economic Research (WIFO)
Name: Serguei Kaniovski P.O.Box 91
Tel.: +43-1-7982601-231 Arsenal Objekt 20
Fax: +43-1-7989386 1103 Vienna, Austria
Mail: [EMAIL PROTECTED] A-1030 Wien
Hello,
The share of concurring votes (i.e. yes-yes and no-no) in total votes
between a pair of voters is a function of their ideological distance (index
continuous on [1,2]).
I show by other means that the votes typically are highly positively
correlated (with an average c=0.6). This is because
Hi,
this is a made-up example. Function myfun returns two arguments. Can
apply be used so that myfun is called only once?
Thanks
Serguei
mat-matrix(runif(50),nrow=10,ncol=5)
myfun-function(x) {
mymean-mean(x)
mysd-sd(x)
return(mymean,mysd)
}
out1-t(apply(mat,1,function(x)
Hallo,
The command:
x - 3
mat - as.matrix(expand.grid(rep(list(0:1), x)))
generates a matrix with 2^x columns containing the binary representations
of the decimals from 0 to (2^x-1), here from 0 to 7. But the rows are not
sorted in this order.
How can sort the rows the ascending order of the
Hi,
I have a number (correlation coefficient) x in [-1,1], and a color
palette col-grey(1:N/N) for a given N. I want to assign a color from col
to x which corresponds to x in levels of cut(-1:1,N).
So for N-4 and x-0.3, the color should be col[3]. For N-4 and x--0.8,
the color should be
which will make the colouring consistent
with that in the legend. Can you help? The number of different colours is
given by the parameter dens.
Thanks,
Serguei Kaniovski
#--FUNC. CORR. PLOT
cor.plot-function(mat, dens, ticks, main=) {
n-dim(mat)[1]
m-dim(mat)[2]
N-ifelse(dens10,10,dens
message as a string and turns into a matrix of
strings. Instead, I want NA in the output matrix each time an error in
optim occurs. I thought try() would handle this? What's the best way of
doing this?
Thanks,
Serguei Kaniovski
[[alternative HTML version deleted
Hallo,
I have a table of names and values:
joe 0.45
mike 0.34
jim 0.25
I would like to fill-in a table of all pairs of names (which I aleady have)
joe.mike NA NA
joe.jim NA NA
mike.jim NA NA
with the values from the first table in the order of the pairs. The outcome
looks like
joe.mike 0.45
in 3
groups.
Thanks a lot,
Serguei Kaniovski
The data looks like:
person;gr;x
mike;gr1;1
jane;gr1;0
bill;gr1;0
jack;gr2;1
mike;gr2;1
jane;gr2;0
bill;gr2;0
alex;gr2;1
james;gr2;1
mike;gr3;0
bill;gr3;1
jane;gr3;1
___
Austrian Institute of Economic Research (WIFO)
Name: Serguei Kaniovski P.O.Box 91
Tel.: +43-1-7982601-231 Arsenal Objekt 20
Fax: +43-1-7989386 1103 Vienna, Austria
Mail: [EMAIL PROTECTED] A-1030 Wien
http://www.wifo.ac.at
/0499;1
093/0499;1
093/0499;1
093/0499;1
093/0499;1
093/0499;1
093/0499;1
--
___
Austrian Institute of Economic Research (WIFO)
Name: Serguei Kaniovski P.O.Box 91
Tel.: +43-1-7982601-231 Arsenal Objekt
Dear All,
the following code, by courtesy of Jacques VESLOT, collates the
following contingency table from DATA (read in as df, sample listed
below)
led represents (court) cases,
jid the (justices) persons, and
vote is the binary state.
The command:
smat-t(apply(combinations(nlevels(df$jid),
Hello,
here is an example from the manual. How to turn this minimization
problem into maximization problem, i.e. -(0 5 0) %*% b - 1/2 b^T b?
# Assume we want to minimize: -(0 5 0) %*% b + 1/2 b^T b
# under the constraints: A^T b = b0
# with b0 = (-8,2,0)^T
# and (-4 2 0)
# A = (-3 1 -2)
# ( 0 0
For example,
year X1958 X1973 X1981 X1986 X1995 X2004 X2007
1 QMT 12 41 45 54 62 232 255
2 Belgium 2 5 5 5 5 12 12
3 France 4 10 10 10 10 29 29
year X1958 X1973 X1981 X1986 X1995 X2004 X2007
1 QMT 12 41 45 54 62 232 255
2 Belgium 9054483 9741700 9859000 9859000 10137000 10418000 10497000
3
How can I, starting from a vector v[1:n], efficiently compute the
coefficients of a 2-argument generating function:
(1+x^v[1]*y)*(1+x^v[2]*y)*...*(1+x^v[n]*y)
and put them in a matrix.
Thanks,
Serguei Kaniovski
--
___
Austrian
Hi all,
how can I divide two tables of the same dimension so that all names are
preserved, ie do not become NA? I have tab1 and tab2, each having
names in the first column. I want tab3 with the same names and values
tab1/tab2.
Thanks,
Serguei
__
--
___
Austrian Institute of Economic Research (WIFO)
Name: Serguei Kaniovski P.O.Box 91
Tel.: +43-1-7982601-231 Arsenal Objekt 20
Fax: +43-1-7989386 1103 Vienna, Austria
Mail: [EMAIL PROTECTED]
http://www.wifo.ac.at/Serguei.Kaniovski
Hi all,
starting from a vector v[1:n] I would like to compute the coefficients
of the polynomial (1+x^v[1])*(1+x^v[2])*...*(1+x^v[n]). The following
code works but is extremely slow for a large n due to, I believe, the
polynomial being factorized. I wanted to try the package polynom
command
(sval,obj, method=BFGS)$par
Thank you,
Serguei
--
___
Austrian Institute of Economic Research (WIFO)
Name: Serguei Kaniovski P.O.Box 91
Tel.: +43-1-7982601-231 Arsenal Objekt 20
Fax: +43-1-7989386
,
Serguei
--
___
Austrian Institute of Economic Research (WIFO)
Name: Serguei Kaniovski P.O.Box 91
Tel.: +43-1-7982601-231 Arsenal Objekt 20
Fax: +43-1-7989386 1103 Vienna, Austria
Mail
.
Thanks a lot,
Serguei
--
___
Austrian Institute of Economic Research (WIFO)
Name: Serguei Kaniovski P.O.Box 91
Tel.: +43-1-7982601-231 Arsenal Objekt 20
Fax: +43-1-7989386 1103
,
b. the first has x=0 - the second has x=1,
c. the first has x=1 - the second has x=0,
d. both have x=0,
The difficulty is that the number of names and their
identity changes from case to case.
Thanks a lot for you help,
Serguei Kaniovski
Thanks Jacques, this works!
Serguei
--
___
Austrian Institute of Economic Research (WIFO)
Name: Serguei Kaniovski P.O.Box 91
Tel.: +43-1-7982601-231 Arsenal Objekt 20
Fax: +43-1-7989386
. the first has 0 - the second has 1,
c. the first has 0 - the second has 0,
d. both have 0.
There will be choose(9,2) sums, denoted s_ij for 1=ij=9,
where i and j are running indices for an id-pair.
Please help, this is way beyond my knowledge of R!
Thank you,
Serguei Kaniovski
collapse (sum) var1
var2 var3, by(date sector).
Thank you,
Serguei Kaniovski
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Hello,
Being new to R, I am completely stuck with the following problem. Please
help to find a general solution to the following matrix task:
Given:
N-4
input_mat-matrix(c(1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0,
Hi, I have a more complex example, but the problem boils down to this
FOR-loop not filling in the res-matrix
run_rows-seq(0,1,0.05)
run_cols-seq(0.3,0.6,0.05)
res-matrix(NA,length(run_rows),length(run_cols))
for(i in run_rows)
{
for(j in run_cols)
{
res[i,j]=i+j
Say I have a FOR-loop for computing powers (just a trivial example)
for(i in 1:5)
{
x-i^2
y-i^3
}
How can I create a data.frame and a 3D plot of (i,x(i),y(i)), i.e. for
each iteration
Thanks,
Serguei Kaniovski
(combinat)
combn(c(0.1,0.2,0.3,0.4),2)
, but to no avail...
Thank you for your help,
Serguei Kaniovski
--
___
Österreichisches Institut für Wirtschaftsforschung (WIFO)
Name: Serguei Kaniovski Postadresse: Postfach 91
Tel
, bvec, meq=0,
factorized=FALSE) reads contraints using an element-by-element
multiplication, i.e. Amat'*x, not using the matrix-product, i.e.
Amat'%*%x, required for the sums on the left-hand-side of 1-6).
I would very much appreciate a suggestion on this problem.
Thank you,
Serguei Kaniovski
to
simplify the above code?
Thank you in advance,
Serguei Kaniovski
--
___
Austrian Institute of Economic Research (WIFO)
Name: Serguei Kaniovski P.O.Box 91
Tel.: +43-1-7982601-243 Arsenal Objekt 20
Fax: +43
one such row.
Serguei Kaniovski
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
37 matches
Mail list logo