[R] why does lm() not allow for negative weights?

2006-08-04 Thread Jens Hainmueller
Dear List, Why do commonly used estimator functions (such as lm(), glm(), etc.) not allow negative case weights? I suspect that there is a good reason for this. Yet, I can see reasonable cases when one wants to use negative case weights. Take lm() for example: ### n - 20 Y - rnorm(n) X -

Re: [R] why does lm() not allow for negative weights?

2006-08-04 Thread Jens Hainmueller
PM An: Jens Hainmueller Cc: r-help@stat.math.ethz.ch Betreff: Re: [R] why does lm() not allow for negative weights? On 8/4/2006 1:26 PM, Jens Hainmueller wrote: Dear List, I suspect that there is a good reason for this. Yet, I can see reasonable cases when one wants to use

[R] sensitivity tests fo causal inference

2005-11-28 Thread Jens Hainmueller
Hi all, Following up on Holger's email last week: Does anyone know if there exists a library that implements the sensitivity tests for hidden bias for matched pairs and unmatched groups as proposed in Rosenbaum's Observational Studies (2002: ch.4)? Thanks. Best, jens

[R] Optim with two constraints

2005-10-12 Thread Jens Hainmueller
Hi R-list, I am new to optimization in R and would appreciate help on the following question. I would like to minimize the following function using two constraints: ## fn - function(par,H,F){ fval - 0.5 * t(par) %*% H %*% par + F%*% par fval } # matrix H is (n by k)

[R] local average

2005-04-20 Thread Jens Hainmueller
Hello, probably this isn't hard, but I can't get R to do this. Thanks for your help! Assume I have a matrix of two covariates: n- 1000 Y- runif(n) X- runif(n,min=0,max=100) data - cbind(Y,X) Now, I would like to compute the local average of Y for each X interval 0-1, 1-2, 2-3, ...

[R] control of font size colour for title, subtitles, axis, and tick marks in LATTICE graph

2004-09-15 Thread Jens Hainmueller
Hi, I very much appreciate any help on this fine tuning problem in a lattice graph (I am new to LATTICE and could not find an example in the help files that worked for me. My apologies if I missed it there). I am running the following box plots to compare conditional distributions of x at

[R] vector extraction

2004-03-08 Thread Jens Hainmueller
Hello, I could need some help on this one: From the data.frame Test.dataset2 below (TSCS data for 151 countries.to.map for year 1973-95; each country.to.map is described by a unique code), I would like to extract a vector color that for each country.to.map takes on the value of dv (a categorical

[R] drawing filled countries according to data using map('world')?

2004-03-07 Thread Jens Hainmueller
Hello, I am looking for somebody who has experience with the map library (Becker and Wilks 1993) and might be able to help me with the following problem: Using the 'world' database I would like to draw filled countries in a world map so that the filling colors of each country corresponds to the

[R] drawing filled countries according to data using map('world')? - follow up

2004-03-07 Thread Jens Hainmueller
[state.to.map, year == 1980] : incorrect number of dimensions What am I doing wrong? (there are a few values missing in fix.float) Thanks for your help! Best Jens Hainmueller __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r