Displaying 20 results from an estimated 1000 matches similar to: "contrasts in lm"
2017 Oct 22
2
Syntax for fit.contrast
I have a model (run with glm) that has a factor, type. Type has two levels, "general" and "regional". I am trying to get estimates (and SEs) for the model with type="general" and type ="regional" using fit.contrast but I can't get the syntax of the coefficients to use in fit.contrast correct. I hope someone can show me how to use fit.contrast, or some
2017 Oct 22
0
Syntax for fit.contrast
> On Oct 22, 2017, at 6:04 AM, Sorkin, John <jsorkin at som.umaryland.edu> wrote:
>
> I have a model (run with glm) that has a factor, type. Type has two levels, "general" and "regional". I am trying to get estimates (and SEs) for the model with type="general" and type ="regional" using fit.contrast
?fit.contrast
No documentation for
2017 Oct 22
3
Syntax for fit.contrast (from package gmodels)
David,
Thank you for responding to my post.
Please consider the following output (typeregional is a factor having two levels, "regional" vs. "general"):
Call:
glm(formula = events ~ type, family = poisson(link = log), data = data,
offset = log(SS))
Deviance Residuals:
Min 1Q Median 3Q Max
-43.606 -17.295 -4.651 4.204 38.421
Coefficients:
2017 Oct 23
2
Syntax for fit.contrast (from package gmodels)
David,
Again you have my thanks!.
You are correct. What I want is not technically a contrast. What I want is the estimate for "regional" and its SE. I don't mind if I get these on the log scale; I can get the anti-log. Can you suggest how I can get the point estimate and its SE for "regional"? The predict function will give the point estimate, but not (to my knowledge)
2017 Oct 22
0
Syntax for fit.contrast (from package gmodels)
> On Oct 22, 2017, at 3:56 PM, Sorkin, John <jsorkin at som.umaryland.edu> wrote:
>
> David,
> Thank you for responding to my post.
>
> Please consider the following output (typeregional is a factor having two levels, "regional" vs. "general"):
> Call:
> glm(formula = events ~ type, family = poisson(link = log), data = data,
> offset =
2017 Oct 23
0
Syntax for fit.contrast (from package gmodels)
> On Oct 22, 2017, at 5:01 PM, Sorkin, John <jsorkin at som.umaryland.edu> wrote:
>
> David,
> Again you have my thanks!.
> You are correct. What I want is not technically a contrast. What I want is the estimate for "regional" and its SE.
There needs to be a reference value for the contrast. Contrasts are differences. I gave you the choice of two references
2017 Oct 23
1
Syntax for fit.contrast (from package gmodels)
David,
predict.glm and se.fit were exactly what I was looking for.
Many thanks!
John
John David Sorkin M.D., Ph.D.
Professor of Medicine
Chief, Biostatistics and Informatics
University of Maryland School of Medicine Division of Gerontology and Geriatric Medicine
Baltimore VA Medical Center
10 North Greene Street
GRECC (BT/18/GR)
Baltimore, MD 21201-1524
(Phone) 410-605-7119
(Fax)
2004 Apr 03
3
Seeking help for outomating regression (over columns) and storing selected output
Hello,
I have spent considerable time trying to figure out that which I am about to describe. This included searching Help, consulting my various R books, and trail and (always) error. I have been assuming I would need to use a loop (looping over columns) but perhaps and apply function would do the trick. I have unsuccessfully tried both.
A scaled down version of my situation is as follows:
2012 Sep 27
1
Package ‘orcutt’ bug?
Hello~
Did any one have used the package 'orcutt' ?
I find that it can not work smoothly in a single variable regression. I use the example following, it function very well.
But when I regress "cons" on "price" (use the "reg1<-lm(cons~price+income+temp)") , then use "reg11<-cochrane.orcutt(reg1)
". There is an error message “Error in
2007 Nov 22
2
Vectorize a correlation matrix
Hello
I can construct a correlation matrix from an (ordered) vector of
correlation coefficients as follows:
x <- c(0.1,0.2,0.3,0.4,0.5)
n <- length(x)
cmat <- diag(rep(0.5,n))
cmat[lower.tri(cmat,diag=0)] <- x
cmat <- cmat+t(cmat)
But how to do the reverse operation, i.e. produce x from cmat?
Thanks for help,
Serguei Kaniovski
[[alternative HTML version deleted]]
2005 Apr 21
1
printCoefmat(signif.legend =FALSE) (PR#7802)
printCoefmat(signif.legend =FALSE) does not work properly. The option
"signif.legend = FALSE" is ignored as shown in the example below.
cmat <- cbind(rnorm(3, 10), sqrt(rchisq(3, 12)))
cmat <- cbind(cmat, cmat[,1]/cmat[,2])
cmat <- cbind(cmat, 2*pnorm(-cmat[,3]))
colnames(cmat) <- c("Estimate", "Std.Err", "Z value", "Pr(>z)")
#
2007 May 19
2
What's wrong with my code ?
I try to code the ULS factor analysis descrbied in
ftp://ftp.spss.com/pub/spss/statistics/spss/algorithms/ factor.pdf
# see PP5-6
factanal.fit.uls <- function(cmat, factors, start=NULL, lower = 0.005,
control = NULL, ...)
{
FAfn <- function(Psi, S, q)
{
Sstar <- S - diag(Psi)
E <- eigen(Sstar, symmetric = TRUE, only.values = TRUE)
e <- E$values[-(1:q)]
e <-
2006 Dec 04
1
Count cases by indicator
Hi,
In the data below, "case" represents cases, "x" binary states. Each
"case" has exactly 9 "x", ie is a binary vector of length 9.
There are 2^9=512 possible combinations of binary states in a given
"case", ie 512 possible vectors. I generate these in the order of the
decimals the vectors represent, as:
2010 Oct 08
3
Efficiency Question - Nested lapply or nested for loop
My data looks like this:
> data
name G_hat_0_0 G_hat_1_0 G_hat_2_0 G_0 G_hat_0_1 G_hat_1_1 G_hat_2_1 G_1
1 rs0 0.488000 0.448625 0.063375 1 0.480875 0.454500 0.064625 1
2 rs1 0.002375 0.955375 0.042250 1 0.000000 0.062875 0.937125 2
3 rs2 0.050375 0.835875 0.113750 1 0.877250 0.115875 0.006875 0
4 rs3 0.000000 0.074750 0.925250 2 0.897750 0.102000
2010 Oct 22
1
lm looking for weights outside of the user-defined function
Dear R'ers,
I am fighting with a problem that is driving me crazy. I use "lm" in
my user-defined function, but it seems to be looking for weights
outside of my function's environment:
### Generating example data:
x<-data.frame(y=rnorm(100,0,1),a=rnorm(100,1,1),b=rnorm(100,2,1))
myweights<-runif(100)
data.for.regression<-x[1:3]
### Creating function
2009 Feb 12
3
get top 50 correlated item from a correlation matrix for each item
Hi,
I have a correlation matrix of about 3000 items, i.e., a 3000*3000
matrix. For each of the 3000 items, I want to get the top 50 items that
have the highest correlation with it (excluding itself) and generate a
data frame with 3 columns like ("ID", "ID2", "cor"), where ID is those
3000 items each repeat 50 times, and ID2 is the top 50 correlated items
with ID,
2002 Apr 09
1
Problem handling NA indexes for character matrixes (PR#1447)
In a package I've been developing for manipulating genetic data I discovered
a problem when indexing into character arrays using NA's:
Create a character matrix and a numeric matrix
> cmat <- matrix( letters[1:4], ncol=2, nrow=2)
> nmat <- matrix( 1:4, ncol=2, nrow=2)
Create an index vector containing an NA value
> indvec <- c(1,2,NA)
Indexing works fine for both
2009 May 26
2
Linear Regression with Constraints
Hi!
I am a bit new to R.
I am looking for the right function to use for a multiple regression problem
of the form:
y = c1 + x1 + (c2 * x2) - (c3 * x3)
Where c1, c2, and c3 are the desired regression coefficients that are
subject to the following constraints:
0.0 < c2 < 1.0, and
0.0 < c3 < 1.0
y, x1, x2, and x3 are observed data.
I have a total of 6 rows of data in a data set.
Is
2006 Mar 15
3
Help on factanal.fit.mle
Hi
Can anybody please suggest me about the documentation of "factanal.fit.mle()"
(Not factanal()------ searching factanal.fit.mle() in R always leads to
factanal()).
Is there any function for doing principal component factor analysis in R.
Regards
Souvik Bandyopadhyay
JRF,
Dept Of Statistics
Calcutta University
[[alternative HTML version deleted]]
2002 Mar 06
2
Announce: R from Python
Hello.
I'm not a regular subscriber in this mailing list, but I think that this
announce may interest somebody. Please, forgive me if this is the wrong place.
Based on the code of RSPython, but modifying it a little, I wrote an interface
for using R from Python. The main reason for writing it was to make it robust,
in order to avoid segmentation faults. Also, it is (IMMO) a very