Re: [R] Linear Logistic Regression - Understanding the output (and possibly the test to use!)

2010-09-04 Thread David Winsemius
On Sep 4, 2010, at 6:53 PM, st...@wittongilbert.free-online.co.uk wrote: Hi I know asking which test to use is frowned upon on this list... so please do read on for at least a couple on sentences... I have some multivariate data slit as follows Tumour Site (one of 5 categories) # Chemo

[R] Linear models (lme4) - basic question

2010-09-02 Thread James Nead
Hi, Sorry for a basic questions on linear models. I am trying to adjust raw data for both fixed and mixed effects. The data that I output should account for these effects, so that I can use the adjusted data for further analysis. For example, if I have the blood sugar levels for 30

Re: [R] Linear models (lme4) - basic question

2010-09-02 Thread Bert Gunter
Why should height be a random effect? I suspect you may need a tutorial on what a random effect in a mixed model is. I see no obvious reason why one would cluster on height. Perhaps if you clarify, it may become obvious either what your concerns are (and that your model is correct) or that you

Re: [R] Linear models (lme4) - basic question

2010-09-02 Thread James Nead
, September 2, 2010 12:46:13 PM Subject: Re: [R] Linear models (lme4) - basic question Why should height be a random effect? I suspect you may need a tutorial on what a random effect in a mixed model is. I see no obvious reason why one would cluster on height. Perhaps if you clarify, it may become

Re: [R] Linear models (lme4) - basic question

2010-09-02 Thread James Nead
, September 2, 2010 12:46:13 PM Subject: Re: [R] Linear models (lme4) - basic question Why should height be a random effect? I suspect you may need a tutorial on what a random effect in a mixed model is. I see no obvious reason why one would cluster on height. Perhaps if you clarify, it may become

Re: [R] Linear models (lme4) - basic question

2010-09-02 Thread Ben Bolker
James Nead james_nead at yahoo.com writes: Sorry, forgot to mention that the processed data will be used as input for a classification algorithm. So, I need to adjust for known effects before I can use the data. I am trying to adjust raw data for both fixed and mixed effects. The

Re: [R] Linear models (lme4) - basic question

2010-09-02 Thread James Nead
Bolker bbol...@gmail.com To: r-h...@stat.math.ethz.ch Sent: Thu, September 2, 2010 2:06:47 PM Subject: Re: [R] Linear models (lme4) - basic question James Nead james_nead at yahoo.com writes: Sorry, forgot to mention that the processed data will be used as input for a classification algorithm. So

Re: [R] Linear models (lme4) - basic question

2010-09-02 Thread Ben Bolker
. *From:* Ben Bolker bbol...@gmail.com *To:* r-h...@stat.math.ethz.ch *Sent:* Thu, September 2, 2010 2:06:47 PM *Subject:* Re: [R] Linear models (lme4) - basic question James Nead james_nead at yahoo.com http://yahoo.com writes

Re: [R] Linear models (lme4) - basic question

2010-09-02 Thread Bert Gunter
:* Ben Bolker bbol...@gmail.com *To:* r-h...@stat.math.ethz.ch *Sent:* Thu, September 2, 2010 2:06:47 PM *Subject:* Re: [R] Linear models (lme4) - basic question James Nead james_nead at yahoo.com http://yahoo.com writes: Sorry, forgot to mention that the processed data will be used

Re: [R] Linear regression equation and coefficient matrix

2010-08-19 Thread ashz
Dear Greg, Thanks for the tip. As I am new in R can you please provide me a script how do to so. It will help my learning process. Thanks, Asher -- View this message in context: http://r.789695.n4.nabble.com/Linear-regression-equation-and-coefficient-matrix-tp2329804p2330867.html Sent from

Re: [R] Linear regression equation and coefficient matrix

2010-08-19 Thread Greg Snow
] On Behalf Of ashz Sent: Thursday, August 19, 2010 3:02 AM To: r-help@r-project.org Subject: Re: [R] Linear regression equation and coefficient matrix Dear Greg, Thanks for the tip. As I am new in R can you please provide me a script how do to so. It will help my learning process. Thanks

[R] Linear regression equation and coefficient matrix

2010-08-18 Thread ashz
Hi, I have 20*60 data matrix (with some NAs) and I wish to perfom a Pearson correlation coefficient matrix as well as simple linear regression equation and coefficient of determination (R2) for every possible combination. Any tip/idea/library/script how do to so. Thanks, As hz -- View

Re: [R] Linear regression equation and coefficient matrix

2010-08-18 Thread Joshua Wiley
On Wed, Aug 18, 2010 at 6:09 AM, ashz a...@walla.co.il wrote: Hi, I have 20*60 data matrix (with some NAs) and I wish to perfom a  Pearson correlation coefficient matrix as well as simple linear regression equation The correlation matrix can be readily obtained by calling cor() on the entire

Re: [R] Linear regression equation and coefficient matrix

2010-08-18 Thread Joshua Wiley
Hmm, after reading one of your other posts, I am thinking you may *just* want all pairwise combinations. This worked for me: # Create a sample data frame with 60 named columns x - data.frame(matrix(rnorm(1200), ncol = 60, dimnames = list(NULL, paste(Col, 1:60, sep='' # calculate the

Re: [R] Linear regression equation and coefficient matrix

2010-08-18 Thread ashz
Hi, Thanks, the cor() works. Regarding the simple linear regression equation (mainly, the slope parameter) and r2. I think I was not writing it well. I need to do it just for the columns. If I have a, b, c, d columns I wish to compute the relation of there data, e.g., between a-b, a-c, a-d,

Re: [R] Linear regression equation and coefficient matrix

2010-08-18 Thread Greg Snow
: Wednesday, August 18, 2010 8:43 AM To: r-help@r-project.org Subject: Re: [R] Linear regression equation and coefficient matrix Hi, Thanks, the cor() works. Regarding the simple linear regression equation (mainly, the slope parameter) and r2. I think I was not writing it well. I need to do

Re: [R] Linear regression on several groups

2010-08-13 Thread Allan Engelhardt
Please read the posting guide and include a standalone example. Maybe you want something like the results from lm(weight ~ Time, data = ChickWeight, subset = Diet==1) lm(weight ~ Time, data = ChickWeight, subset = Diet==2) ## ... etc ... Then you could do (m - lm(weight ~ Time*Diet, data =

Re: [R] Linear regression on several groups

2010-08-13 Thread Eik Vettorazzi
hi, maybe an ANCOVA is what you want, which is also done by lm in R lm(y~x*z) Am 12.08.2010 17:11, schrieb JesperHybel: I have a simple dataset of a numerical dependent Y, a numerical independent X and a categorial variable Z with three levels. I want to do linear regression Y~X for each

Re: [R] Linear regression on several groups

2010-08-13 Thread JesperHybel
Example is spot on - sr for not providing one myself. The results you calculate are what I'm looking for. Would like a function F where I could type: F(weight ~ Time, data = ChickWeight, SOME ARGUMENT = Diet)) Resulting in for (i in 1:4){ print( lm(weight ~ Time, data = ChickWeight, subset =

Re: [R] Linear regression on several groups

2010-08-13 Thread Derek Ogle
Have a look at lmList() in the nlme package. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] On Behalf Of JesperHybel Sent: Friday, August 13, 2010 7:56 AM To: r-help@r-project.org Subject: Re: [R] Linear regression on several groups

[R] Linear regression on several groups

2010-08-12 Thread JesperHybel
I have a simple dataset of a numerical dependent Y, a numerical independent X and a categorial variable Z with three levels. I want to do linear regression Y~X for each level of Z. How can I do this in a single command that is without using lm() applied three isolated times? -- View this message

[R] linear model with similar response predictor

2010-08-05 Thread Giuseppe Amatulli
Hi, can somebody tell me why R is not able to calculate a linear model written in this way? lm (seq(1:100)~seq(1:100)) Call: lm(formula = seq(1:100) ~ seq(1:100)) Coefficients: (Intercept) 50.5 Warning messages: 1: In model.matrix.default(mt, mf, contrasts) : the response appeared on

Re: [R] linear model with similar response predictor

2010-08-05 Thread Erik Iverson
On 08/05/2010 05:50 AM, Giuseppe Amatulli wrote: Hi, can somebody tell me why R is not able to calculate a linear model written in this way? lm (seq(1:100)~seq(1:100)) Call: lm(formula = seq(1:100) ~ seq(1:100)) Coefficients: (Intercept) 50.5 Warning messages: 1: In

Re: [R] linear model with similar response predictor

2010-08-05 Thread David Winsemius
On Aug 5, 2010, at 6:50 AM, Giuseppe Amatulli wrote: Hi, can somebody tell me why R is not able to calculate a linear model written in this way? lm (seq(1:100)~seq(1:100)) Call: lm(formula = seq(1:100) ~ seq(1:100)) Coefficients: (Intercept) 50.5 Warning messages: 1: In

[R] Linear Interpolation question

2010-07-29 Thread Ralf B
Hi R experts, I have the following timeseries data: #example data structure a - c(NA,1,NA,5,NA,NA,NA,10,NA,NA) c - c(1:10) df - data.frame(timestamp=a, sequence=c) print(df) where i would like to linearly interpolate between the points 1,5, and 10 in 'timestamp'. Original timestamps should not

Re: [R] Linear Interpolation question

2010-07-29 Thread Gabor Grothendieck
On Thu, Jul 29, 2010 at 5:16 PM, Ralf B ralf.bie...@gmail.com wrote: Hi R experts, I have the following timeseries data: #example data structure a - c(NA,1,NA,5,NA,NA,NA,10,NA,NA) c - c(1:10) df - data.frame(timestamp=a, sequence=c) print(df) where i would like to linearly interpolate

Re: [R] linear predicted values of the index function in an ordered probit model

2010-06-29 Thread David Winsemius
On Jun 28, 2010, at 10:58 AM, Martin Spindler wrote: Hello, currently I am estimating an ordered probit model with the function polr (MASS package). Is there a simple way to obtain values for the prediction of the index function ($X*\hat{\beta}$)? (E..g. in the GLM function there is

[R] linear predicted values of the index function in an ordered probit model

2010-06-28 Thread Martin Spindler
Hello, currently I am estimating an ordered probit model with the function polr (MASS package). Is there a simple way to obtain values for the prediction of the index function ($X*\hat{\beta}$)? (E..g. in the GLM function there is the linear.prediction value for this purpose). If not,

Re: [R] Linear Discriminant Analysis in R

2010-06-02 Thread cobbler_squad
Joris, Thank you, I have corrected my mistakes. I very much appreciate your time and patience. All my best, Cobbler. -- View this message in context: http://r.789695.n4.nabble.com/Linear-Discriminant-Analysis-in-R-tp2231922p2240547.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Linear Discriminant Analysis in R

2010-05-31 Thread Joris Meys
I checked your data. Now I have to get some sense out of your code. You do : G - vowel_features[15] cvc_lda - lda(G~ vowel_features[15], data=mask_features, na.action=na.omit, CV=TRUE) Firstly, as I suspected, you need to select a column by using vowel_features[,15] . Mind the comma!

Re: [R] Linear Discriminant Analysis in R

2010-05-30 Thread cobbler_squad
Hi Janis, As you have suggested below is the output for the following: test.vowel - vowel_features[,1:10] test.mask - mask_features[,1:10] dput(test.vowel) dput(test.mask) --- NOTE: outputs are limited test_vowel first 12 columns are all zero (total of 26 columns) V1 V2 V3 V4

Re: [R] Linear Discriminant Analysis in R

2010-05-29 Thread cobbler_squad
Thanks for being patient with me. I guess my problem is with understand how grouping in this particular case is used: one of the sample codes I found online (http://www.statmethods.net/advstats/discriminant.html) library(MASS) fit - lda(G ~ x1 + x2 + x3, data=mydata, na.action=na.omit, CV=TRUE)

Re: [R] Linear Discriminant Analysis in R

2010-05-29 Thread Joris Meys
It's not your questions, Cobbler, but could you PLEASE just do what we asked for? Copy-paste the following in R and copy-paste ALL output you get in your next mail. test.vowel - vowel_features[,1:10] test.mask - mask_features[,1:10] dput(test.vowel) dput(test.mask) I don't know whether your

Re: [R] Linear Discriminant Analysis in R

2010-05-28 Thread Joris Meys
Could you provide us with data to test the code? use dput (and limit the size!) eg: dput(vowel_features) dput(mask_features) Without this information, it's impossible to say what's going wrong. It looks like you're doing something wrong in the selection. What should vowel_features[15]

Re: [R] Linear Discriminant Analysis in R

2010-05-28 Thread Liaw, Andy
28, 2010 8:50 AM To: cobbler_squad Cc: r-help@r-project.org Subject: Re: [R] Linear Discriminant Analysis in R Could you provide us with data to test the code? use dput (and limit the size!) eg: dput(vowel_features) dput(mask_features) Without this information, it's impossible

Re: [R] Linear Discriminant Analysis in R

2010-05-27 Thread cobbler_squad
Joris, You are a life saver. Based on two sample files above, I think lda should go something like this: vowel_features - read.table(file = mappings_for_vowels.txt) mask_features - data.frame(as.matrix(read.table(file = 3dmaskdump_ICA_37_Combined.txt))) G - vowel_features[15] cvc_lda - lda(G~

[R] Linear Discriminant Analysis in R

2010-05-26 Thread cobbler_squad
Dear R gurus, Thank you all for continuous support and guidance -- learning without you would not be efficient. I have a question regarding LD analysis and how to best code it up in R. I have a file of (V52 and 671 time points across all columns) and another file of phonetic features (each

Re: [R] Linear Discriminant Analysis in R

2010-05-26 Thread Joris Meys
Why exactly do you need lda and not another method? For lda to be applicable, you should check : 1) whether the regressors are normally distributed within the classes 2) whether the variance-covariance matrices are equal for all classes Essentially, this means that the boundary between both

Re: [R] Linear mixed models with custom link functions in R

2010-03-27 Thread Ben Bolker
Daniel Barton daniel.barton at umontana.edu writes: Hello All, I am looking for an R library/function that allows the specification of a custom link function in a linear mixed model. You might want to try on the r-sig-mixed-mod...@r-project.org list. I would probably call this a

[R] Linear Discriminant Analysis

2010-03-23 Thread L L
Hi, I was wondering if you can show me how to plot the discriminant boundary lines for an LD analysis in R. I am curious as to perform this on a larger scale, so I was wondering if you can provide me an example on the infamous 'iris' data. Here's what I have so far: iris.lda=lda(Species ~.,

[R] Linear models interaction

2010-02-25 Thread gauravbhatti
My data looks like following: cera3[i, ] batch lcl29 pdt Untreated 3.185867 1 0 0 Untreated.4 3.185867 0 0 0 LCL29 4.357552 1 1 0 LCL29.6 3.446256 0 1 0 PDT 2.765535 1 0 1 PDT.5 3.584963

Re: [R] Linear models interaction

2010-02-25 Thread Dieter Menne
gauravbhatti wrote: My data looks like following: cera3[i, ] batch lcl29 pdt Untreated 3.185867 1 0 0 Untreated.4 3.185867 0 0 0 LCL29 4.357552 1 1 0 LCL29.6 3.446256 0 1 0 PDT 2.765535 1

[R] linear predictors and survreg function

2010-02-09 Thread carol white
Hi, I calculated the linear predictors derived from weibull model using ovarian data sets. I calculated the linear predictors as the sum of covariates weighted by the weibull coefficients and compared to the linear predictors generated by survreg function. Why are they different? note that the

Re: [R] linear predictors and survreg function

2010-02-09 Thread GlenB
Note that the first set of coefficients minus the second set of coefficients is constant (12.78262) -- View this message in context: http://n4.nabble.com/linear-predictors-and-survreg-function-tp1474388p1475332.html Sent from the R help mailing list archive at Nabble.com.

[R] linear models with variance in dependent and independent variables

2010-01-31 Thread Julian Burgos
Dear list, I need to fit a multiple regression in which individual data point in the independent and the dependent variables have an associated variance or standard deviation. To make things clear, instead of having just a table of dependent (X) and independent (Y1, Y2) variable values like

[R] Linear regression - R^2

2010-01-09 Thread Csanád Bertók
Hello, I was doing a linear regression with the following formula: *lm(y~x+0)*, so it passes through the origin. But when I called the summary of the regression i saw that R squared is abnormally high (it's a lot lower in other programs such as SigmaPlot and MS Excel).The manual explained the

Re: [R] Linear regression - R^2

2010-01-09 Thread milton ruser
Dear Csanad, PLEASE do read the posting guide http://www.R-project.org/posting-guide.htmlhttp://www.r-project.org/posting-guide.html Reproducible code/problem are welcome. By the way, who you believe is right? bests milton On Sat, Jan 9, 2010 at 5:40 PM, Csanád Bertók

[R] Linear Discriminant Analysis in R

2010-01-04 Thread cobbler_squad
Dear R-gurus, Here is what I need to do.. I have two .txt files that are in a matrix form (each looks something like this: 0.0334820.02238 0.026677 0.0345530.0232260.028855 0.0350170.0232620.02941 0.0362620.023306

[R] linear contrasts for trends in an anova

2009-12-18 Thread Colm Connolly
Hi everybody, I'm trying to construct contrasts for an ANOVA to determine if there is a significant trend in the means of my groups. In the following example, based on the type of 2x3 ANOVA I'm trying to perform, does the linear polynomial contrast generated by contr.poly allow me to test for

Re: [R] linear contrasts for trends in an anova

2009-12-18 Thread ONKELINX, Thierry
...@stat.math.ethz.ch Onderwerp: [R] linear contrasts for trends in an anova Hi everybody, I'm trying to construct contrasts for an ANOVA to determine if there is a significant trend in the means of my groups. In the following example, based on the type of 2x3 ANOVA I'm trying to perform, does the linear

[R] linear regression on groups of consecutive rows of a matrix

2009-11-24 Thread Jim Bouldin
I want to perform linear regression on groups of consecutive rows--say 5 to 10 such--of two matrices. There are many such potential groups because the matrices have thousands of rows. The matrices are both of the form: shp[1:5,16:20] SL495B SL004C SL005C SL005A SL017A -2649 1.06 0.56

Re: [R] linear regression on groups of consecutive rows of a matrix

2009-11-24 Thread David Winsemius
Perhaps along these lines: 1st #need to decide what your group width is , so the second number inside the extraction call will be that number minus 1: for (x in seq(1:1000, by=6) { temp - na,omit( shp[x:(x+5), ] ) # Need the parens in x:(x+5) lm( formula, data=temp) } Or

Re: [R] linear regression on groups of consecutive rows of a matrix

2009-11-24 Thread Jim Bouldin
But I do feel compelled to ask: Do you really get meaningful information from lm applied to 5 cases? Especially when the predictors used may not be the same from subset to subset??? Thanks again for your help David. Your question is a good one. It's a bit complicated but here's the

[R] Linear Discriminant Analysis and Wilks Lambda

2009-11-18 Thread Julius Tesoro
Dear all, I am trying to recreate a discriminant analysis in R based on the article from Dong,J.-J.,etal.,Discriminant analysis of the geomorphic characteristics and stability of landslide dams, Geomorphology (2009). I used lda (MASS) to determine the discriminant functions but I noticed that

Re: [R] linear model and by()

2009-11-14 Thread David Winsemius
On Nov 13, 2009, at 11:49 AM, Sam Albers wrote: Hello R list, snipped answered question Sorry to not use your data but it's not in a form that lends itself very well to quick testing. If you had included the input commands I might have tried it. No problem not use my data. For

Re: [R] LINEAR MIXED EFFECT

2009-11-13 Thread ANARPCG
Douglas Bates-2 wrote: On Thu, Nov 12, 2009 at 10:14 AM, milton ruser milton.ru...@gmail.com wrote: Hi Ana, I am not quite sure if it is the problem, but if you call your data.frame as exp, you will crash exp() function... try use another name for your data.frame. By the way, I

Re: [R] linear model and by()

2009-11-13 Thread Sam Albers
Hello R list, This is a question for anyone who has used the by() command. I would like to perform a regression on a data frame by several factors. Using by() I think that I have able to perform this using the following: lm.r - by(master, list(Sectionf=Sectionf, startd=startd),

Re: [R] linear model and by()

2009-11-13 Thread Ista Zahn
On Fri, Nov 13, 2009 at 11:49 AM, Sam Albers tonightstheni...@gmail.com wrote: snip No problem not use my data. For future reference, would it have been easier to attach a .csv file and then include the appropriate read.csv command? I realized that the easier one makes it to help, the easier it

Re: [R] LINEAR MIXED EFFECT

2009-11-13 Thread milton ruser
Hi Ana, you did again :-) require(fortunes) fortune(dog) Firstly, don't call your matrix 'matrix'. Would you call your dog 'dog'? Anyway, it might clash with the function 'matrix'. -- Barry Rowlingson R-help (October 2004) if you call your data data you will crach data() function.

Re: [R] LINEAR MIXED EFFECT

2009-11-13 Thread tlumley
On Fri, 13 Nov 2009, milton ruser wrote: Hi Ana, you did again :-) require(fortunes) fortune(dog) Firstly, don't call your matrix 'matrix'. Would you call your dog 'dog'? Anyway, it might clash with the function 'matrix'. -- Barry Rowlingson R-help (October 2004) if you call your data

Re: [R] LINEAR MIXED EFFECT

2009-11-12 Thread ANARPCG
Milton's point is dead-on, and I would highly encourage you to give the posting guide a look. That said... you might try na.action = na.omit in your call to... actually, we don't know what function you are using (see first point). Regardless, sounds like you have missing data and na.action

Re: [R] LINEAR MIXED EFFECT

2009-11-12 Thread Douglas Bates
On Thu, Nov 12, 2009 at 10:14 AM, milton ruser milton.ru...@gmail.com wrote: Hi Ana, I am not quite sure if it is the problem, but if you call your data.frame as exp, you will crash exp() function... try use another name for your data.frame. By the way, I suggest you not use attach(). Try

[R] linear model and by()

2009-11-12 Thread Sam Albers
Hello R list, This is a question for anyone who has used the by() command. I would like to perform a regression on a data frame by several factors. Using by() I think that I have able to perform this using the following: lm.r - by(master, list(Sectionf=Sectionf, startd=startd), function(x) lm

Re: [R] linear model and by()

2009-11-12 Thread Ista Zahn
Hi, You have not given us all the data needed to reproduce your analysis (what is SectionF?), but the issue is probably that lm.r is a list and you're not treating it that way. Try srt(lm.r) and summary(lm.r[[1]]) You may also want to look at the the lmList() function in the lme4 package.

[R] LINEAR MIXED EFFECT

2009-11-11 Thread ANARPCG
CAN ANYONE PLEASE HELP ME WITH THIS i HAVE TO DO A MIXED EFFECT LINEAR MODEL WITH MY DATA DUE TO THE FACT THAT I have pseudoreplication! Although after reading and trying it for several times can get around due to Error in na.fail.default(list(date = c(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, : missing

Re: [R] LINEAR MIXED EFFECT

2009-11-11 Thread milton ruser
Dear Ana Golveia, It is completelly impossible someone realise what kind or help you need or what is happening. I suggest you give a look on the posting guide, mainly that part about a minimum reproducible code with self explaining information, etc. Cheers milton On Wed, Nov 11, 2009 at 7:22

Re: [R] LINEAR MIXED EFFECT

2009-11-11 Thread Dave Atkins
Milton's point is dead-on, and I would highly encourage you to give the posting guide a look. That said... you might try na.action = na.omit in your call to... actually, we don't know what function you are using (see first point). Regardless, sounds like you have missing data and na.action is

Re: [R] linear trend line and a quadratic trend line.

2009-11-10 Thread ONKELINX, Thierry
-project.org Onderwerp: [R] linear trend line and a quadratic trend line. Dear list users How is it possible to visualise both a linear trend line and a quadratic trend line on a plot of two variables? Here my almost working exsample. data(Duncan) attach(Duncan) plot(prestige ~ income

Re: [R] linear trend line and a quadratic trend line.

2009-11-08 Thread Peter Dalgaard
Eric Fail wrote: Dear list users How is it possible to visualise both a linear trend line and a quadratic trend line on a plot of two variables? Here my almost working exsample. data(Duncan) attach(Duncan) plot(prestige ~ income) abline(lm(prestige ~ income), col=2, lwd=2) Now

[R] Linear Regression Model with GARCH errors

2009-10-22 Thread Ioana D
Hello I was wondering if there is any possibility of estimating a linear regression model with GARCH errors in R? I tried using fGarch library, but I could only find for instance how to estimate arma-garch models or similar combinations. Thank you, Ioana -- View this message in context:

[R] linear regression: Is there a way to get the results of lm as variables

2009-10-21 Thread CE.KA
Hi R users I used R to get the results of a linear regression reg-lm(y~x) here are the results: # Call: # lm(formula = donnees$txi7098 ~ donnees$txs7098) # # Residuals: # Min

Re: [R] linear regression: Is there a way to get the results of lm as variables

2009-10-21 Thread Jorge Ivan Velez
Hi CE.KA, Take a look at the following: # Data set.seed(123) x - rnorm(100) y - 2 + 1.5*x + rnorm(100) # Regression model reg - lm(y ~ x) # The summary summary(reg) # Objects present in the summary() names(summary(reg)) # Extracting the coefficients summary(reg)$coeff HTH, Jorge On Wed,

[R] Linear Regression Question

2009-10-14 Thread Alexandre Cohen
Dear Sir or Madam, I am a student at MSc Probability and Finance at Paris 6 University/ Ecole Polytechnique. I am using R and I can't find an answer to the following question. I will be very thankful if you can answer it. I have two vectors rendements_CAC40 and rendements_AlcatelLucent. I use

Re: [R] Linear Regression Question

2009-10-14 Thread Jakson A. Aquino
On Tue, Oct 13, 2009 at 11:17:11PM +0200, Alexandre Cohen wrote: I have two vectors rendements_CAC40 and rendements_AlcatelLucent. I use the lm function as follows, and then the sumarry function: regression=lm(rendements_CAC40 ~ rendements_AlcatelLucent); sum=summarry(regression); [...] I

Re: [R] Linear Regression Question

2009-10-14 Thread Ted Harding
On 13-Oct-09 21:17:11, Alexandre Cohen wrote: Dear Sir or Madam, I am a student at MSc Probability and Finance at Paris 6 University/ Ecole Polytechnique. I am using R and I can't find an answer to the following question. I will be very thankful if you can answer it. I have two vectors

Re: [R] Linear Regression Question

2009-10-14 Thread Peter Ehlers
Alexandre, Let me add two small points to Ted's exposition: 1. you can use the extractor function coefficients(), or just coef() on the summary: coef(summary(regression)) which will also give you the matrix of estimates, etc. 2. You will find that using the function str() often is

[R] Linear mixed effects model ?

2009-10-06 Thread Daniel Perkins
I am looking for some advice on an appropriate statistical analysis in R *Experimental question* : We are interested in how communities from different streams may vary in their response to experimental temperature. Specifically we are interested to test for differences in the slope and

Re: [R] linear model with coefficient constraints

2009-10-06 Thread Dieter Menne
Rnewb wrote: I would like to perform a regression like the one below: lm(x ~ 0 + a1 + a2 + a3 + b1 + b2 + b3 + c1 + c2 + c3, data=data) However, the data has the property that a1+a2+a3 = A, b1+b2+b3 = B, and c1+c2+c3 = C, where A, B, Ravi Varadhan has an example how this could be

Re: [R] Linear mixed effects model ?

2009-10-06 Thread Dieter Menne
Daniel Perkins wrote: Ideally we would do an ANCOVA to test for differences in slope or intercepts for the different streams. However as there were repeated measures and unequal n and unbalanced design, I have used a linear mixed effect model (from nlme package in R) in the form:

[R] linear model with coefficient constraints

2009-10-06 Thread Rnewb
I would like to perform a regression like the one below: lm(x ~ 0 + a1 + a2 + a3 + b1 + b2 + b3 + c1 + c2 + c3, data=data) However, the data has the property that a1+a2+a3 = A, b1+b2+b3 = B, and c1+c2+c3 = C, where A, B, and C are positive constants. So there are two extra degrees of freedom,

[R] Linear Model NA Value Test

2009-09-22 Thread dmhultst
Hello, I am deriving near real-time liner relationships based on 5-min precipitation data, sometimes the non-qced data result in a slope of NA. I am trying to read the coefficient (in this example x) to see if it is equal to NA, if it is equal to NA assign it a value of 1. I am having trouble

[R] Linear Model NA Value Test

2009-09-21 Thread Douglas M. Hultstrand
Hello, I am deriving near real-time liner relationships based on 5-min precipitation data, sometimes the non-qced data result in a slope of NA. I am trying to read the coefficient (in this example x) to see if it is equal to NA, if it is equal to NA assign it a value of 1. I am having trouble

Re: [R] Linear Model NA Value Test

2009-09-21 Thread Erik Iverson
if(fit$coef[[2]] == NA) {.cw = 1} See ?is.na __ R-help@r-project.org 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,

Re: [R] Linear Model NA Value Test

2009-09-21 Thread David Winsemius
On Sep 21, 2009, at 4:38 PM, Douglas M. Hultstrand wrote: Hello, I am deriving near real-time liner relationships based on 5-min precipitation data, sometimes the non-qced data result in a slope of NA. I am trying to read the coefficient (in this example x) to see if it is equal to NA,

Re: [R] Linear Model NA Value Test

2009-09-21 Thread David Winsemius
On Sep 21, 2009, at 4:50 PM, David Winsemius wrote: On Sep 21, 2009, at 4:38 PM, Douglas M. Hultstrand wrote: Hello, I am deriving near real-time liner relationships based on 5-min precipitation data, sometimes the non-qced data result in a slope of NA. I am trying to read the

Re: [R] Linear Model NA Value Test

2009-09-21 Thread Ted Harding
On 21-Sep-09 20:38:25, Douglas M. Hultstrand wrote: Hello, I am deriving near real-time liner relationships based on 5-min precipitation data, sometimes the non-qced data result in a slope of NA. I am trying to read the coefficient (in this example x) to see if it is equal to NA, if it is

[R] Linear objective function with Quadratic constraints

2009-09-18 Thread vikrant S
I am new to R and I want to solve this following problem using R. My Objective function is a linear function with Quadratic constraints.I want to know how to solve this problem and which package will be helpful for me for solving such type of problems.Moreover my one constraint is linear and

Re: [R] linear regression, exclude a datum

2009-09-15 Thread e-letter
On 14/09/2009, Steve Lianoglou mailinglist.honey...@gmail.com wrote: Hi, On Sep 14, 2009, at 9:47 AM, e-letter wrote: Readers, I have been reading the r book (Crawley) and tried to use the influence measures function for linear regression, as described. I have one datum that I wish to

Re: [R] linear regression, exclude a datum

2009-09-15 Thread Uwe Ligges
e-letter wrote: On 14/09/2009, Steve Lianoglou mailinglist.honey...@gmail.com wrote: Hi, On Sep 14, 2009, at 9:47 AM, e-letter wrote: Readers, I have been reading the r book (Crawley) and tried to use the influence measures function for linear regression, as described. I have one datum

Re: [R] linear regression, exclude a datum

2009-09-15 Thread e-letter
On 15/09/2009, Uwe Ligges lig...@statistik.tu-dortmund.de wrote: e-letter wrote: On 14/09/2009, Steve Lianoglou mailinglist.honey...@gmail.com wrote: Hi, On Sep 14, 2009, at 9:47 AM, e-letter wrote: Readers, I have been reading the r book (Crawley) and tried to use the influence

Re: [R] linear regression, exclude a datum

2009-09-15 Thread Uwe Ligges
e-letter wrote: On 15/09/2009, Uwe Ligges lig...@statistik.tu-dortmund.de wrote: e-letter wrote: On 14/09/2009, Steve Lianoglou mailinglist.honey...@gmail.com wrote: Hi, On Sep 14, 2009, at 9:47 AM, e-letter wrote: Readers, I have been reading the r book (Crawley) and tried to use the

[R] linear regression, exclude a datum

2009-09-14 Thread e-letter
Readers, I have been reading the r book (Crawley) and tried to use the influence measures function for linear regression, as described. I have one datum that I wish to show in the graph but exclude from the regression and ab line. x y 0 5 10 9 20 10 30 19 40 4

Re: [R] linear regression, exclude a datum

2009-09-14 Thread Steve Lianoglou
Hi, On Sep 14, 2009, at 9:47 AM, e-letter wrote: Readers, I have been reading the r book (Crawley) and tried to use the influence measures function for linear regression, as described. I have one datum that I wish to show in the graph but exclude from the regression and ab line. x y 0

Re: [R] linear mixed model question

2009-09-07 Thread ONKELINX, Thierry
Wen Huang Verzonden: zondag 6 september 2009 17:49 Aan: r-help@r-project.org Onderwerp: [R] linear mixed model question Hello, I wanted to fit a linear mixed model to a data that is similar in terms of design to the 'Machines' data in 'nlme' package except that each worker (with triplicates) only

Re: [R] linear mixed model question

2009-09-07 Thread Jason Morgan
Hello Wen: On 2009.09.06 10:49:03, Wen Huang wrote: Hello, I wanted to fit a linear mixed model to a data that is similar in terms of design to the 'Machines' data in 'nlme' package except that each worker (with triplicates) only operates one machine. I created a subset of

Re: [R] linear mixed model question

2009-09-07 Thread Daniel Malter
Wen, to follow up on Thierry, your workers are nested in machines (since each worker only works one machine). Consider fitting a nested model. Though, with few observations, you might run into the same problem. Further, if you have observation triplets, and you expect systematic differences

Re: [R] linear mixed model question

2009-09-07 Thread Daniel Malter
The workers=as.factor(workers) codeline in my post dropped below my name. It should be in the code before the command line for the linear model. Daniel Malter wrote: Wen, to follow up on Thierry, your workers are nested in machines (since each worker only works one machine). Consider

[R] linear mixed model question

2009-09-06 Thread Wen Huang
Hello, I wanted to fit a linear mixed model to a data that is similar in terms of design to the 'Machines' data in 'nlme' package except that each worker (with triplicates) only operates one machine. I created a subset of observations from 'Machines' data such that it looks the same as

[R] linear regression between two lists of vectors?

2009-09-05 Thread Peng Yu
Hi, I am not familiar enough with statistics yet. Please excuse me if my question is wrong. In the simplest form of linear regression, the data points are two list of scalars x_1, ..., x_n and y_1, ..., y_n. I am wondering if there is a linear regression for two lists of vectors X_1, ..., X_n

[R] Linear Contrasts in GLM - Query

2009-09-04 Thread Leo Guelman
Hi, Is there a way I can specify linear contrasts in glm? I'm looking for something equivalent to SAS' contrast statement. I'd like to do the following, suppose I have a categorical input with 4 levels (a,b,c,d), I'd like to test something like: (i) a+b=c+d, (ii) a=b, (iii) a=b+d, etc...

<    1   2   3   4   5   >