[R] Outlier Detection

2013-04-01 Thread Ralph Fehrer
I am about to evaluate the outlier detection mode of random forests. At [1]http://www.stat.berkeley.edu/~breiman/RandomForests/cc_home.htm#outliers the raw outlier measure for a case n is defined as nsample/AverageProximity I wasn't able to figure out, what "nsample" stands for

[R] gdata selectively not working

2013-04-01 Thread Robin Jeffries
I can use gdata to successfully read in the example Excel file, but not any other excel files. Why might this be the case? It seems that the problem has something to do with opening the database but no indication as to what the problem is. So i'm at a loss of how to fix it. > library(gdata) gdata

Re: [R] 95% Confidence Interval for a p-p plot

2013-04-01 Thread Jorge I Velez
Pablo, Check the qqPlot function in "car": require(car) qqPlot(x, dist = "gamma", shape = 1.7918012, rate = 0.9458022) Best, Jorge.- On Tue, Apr 2, 2013 at 4:41 AM, pablo.castano <> wrote: > Hi, > > I want to create upper and lower 95% confidence intervals for a p-p plot of > an empirical di

Re: [R] please help, iteration through a list of files and plot each one

2013-04-01 Thread Shane McMahon
There's probably a better way to do it, but here's one way: require(stringr) windows() file_list <- list.files(pattern=".txt") for (file in file_list) { dataset <- read.table(file, header=TRUE, sep="\t") plot(dataset) savePlot(filename=str_replace(file,".txt",""),type="png")

Re: [R] please help, iteration through a list of files and plot each one

2013-04-01 Thread arun
Hi, May be this helps. list.files() #[1] "file1.txt" "file2.txt" "file3.txt"  lapply(list.files(),function(x) {x1<-read.table(x,header=TRUE);x2<-gsub("txt","png",x);png(x2);plot(col2~col1,data=x1,type="l");dev.off()}) A.K. - Original Message - From: David Lyon To: "r-help@r-project.or

[R] please help, iteration through a list of files and plot each one

2013-04-01 Thread David Lyon
I have many files in 1 directory, file names end in .txt. Each file has 2 columns col1 col2 2 3 3 4 4 5 5 6 I want to make a list of the file names and iterate through each plotting them in a separate file $filename\.png with the png swapped for txt. So far I have this, can someone help

Re: [R] Error message in dredge function (MuMIn package) used with binary GLM

2013-04-01 Thread CatCowie
Hi Kamil, (I have replied to the forum but my posts as replies never seem to get accepted, so here is the text in an email also. Apologies if it comes through twice.) Thanks so much for the prompt reply. You've solved it! Actually I had the latest version of the package, but an older version of R

[R] ctree (party) - select a specific variable in the first split

2013-04-01 Thread Salvatore Loguercio
Hello, My question is related to ctree() function from the library 'party'. Is there a way to force ctree() to use a specific variable in the first split? I am asking because the first split contains two variables with very similar scores, and choosing the alternative variable would induce a t

Re: [R] How to remove all characters after comma in R

2013-04-01 Thread Peter Ehlers
On 2013-04-01 19:23, arun wrote: gsub("\\,.*","",x) #[1] "foo" "bar" "qux" A.K. No big deal, but does "," have to be escaped? sub(",.*", "", x) Peter Ehlers - Original Message - From: Gundala Viswanath To: "r-h...@stat.math.ethz.ch" Cc: Sent: Monday, April 1, 2013 10:13 PM Subjec

Re: [R] How to remove all characters after comma in R

2013-04-01 Thread Rolf Turner
On 04/02/2013 03:13 PM, Gundala Viswanath wrote: I have the following list of strings: x <- c("foo, foo2, foo3", "bar", "qux, qux1") what I want to do is to obtain foo, bar qux Namely for each element in the vector obtain only string before the first comma. What's the way to do it? This se

Re: [R] How to remove all characters after comma in R

2013-04-01 Thread arun
gsub("\\,.*","",x) #[1] "foo" "bar" "qux" A.K. - Original Message - From: Gundala Viswanath To: "r-h...@stat.math.ethz.ch" Cc: Sent: Monday, April 1, 2013 10:13 PM Subject: [R] How to remove all characters after comma in R I have the following list of strings: x <- c("foo, foo2, foo

[R] How to remove all characters after comma in R

2013-04-01 Thread Gundala Viswanath
I have the following list of strings: x <- c("foo, foo2, foo3", "bar", "qux, qux1") what I want to do is to obtain foo, bar qux Namely for each element in the vector obtain only string before the first comma. What's the way to do it? - G.V. [[alternative HTML version deleted]] _

Re: [R] Image segmentation

2013-04-01 Thread David Winsemius
On Apr 1, 2013, at 7:50 AM, Eder Paulo wrote: > Hi, > > I work with > remote sensing in Brazil. I would like to know if there is any algorithm or > package that does image segmentation by region growing in R. > It's possible that there is a domain of investigation where the phrase " image seg

Re: [R] Console display "buffer size"

2013-04-01 Thread Peter Ehlers
On 2013-04-01 15:06, Ted Harding wrote: On 01-Apr-2013 21:26:07 Robert Baer wrote: On 4/1/2013 4:08 PM, Peter Ehlers wrote: On 2013-04-01 13:37, Ted Harding wrote: Greetings All. This is a somewhat generic query (I'm really asking on behalf of a friend who uses R on Windows, whereas I'm on Lin

Re: [R] Console display "buffer size"

2013-04-01 Thread Ted Harding
On 01-Apr-2013 21:26:07 Robert Baer wrote: > On 4/1/2013 4:08 PM, Peter Ehlers wrote: >> On 2013-04-01 13:37, Ted Harding wrote: >>> Greetings All. >>> This is a somewhat generic query (I'm really asking on behalf >>> of a friend who uses R on Windows, whereas I'm on Linux, but >>> the same phenome

[R] Left join in R

2013-04-01 Thread ramoss
I have never used the data.table package. I am trying to do the following SQL left join in R create table all as select a.* from dates b left outerjoin activitycount a on a.tdate=b.tdate and a.activity=b.activity

Re: [R] Factor to numeric conversion - as.numeric(levels(f))[f] - Language definition seems to say to not use this.

2013-04-01 Thread Peter Ehlers
On 2013-04-01 13:08, Matthew Lundberg wrote: Note the edited subject line! I don't know why I typed it as it was before. This says that as.numeric(as.character(f)) will work regardless of the implementation, and I agree. It's the recommendation to use as.numeric(levels(f))[f] that has me wonde

Re: [R] Console display "buffer size"

2013-04-01 Thread Robert Baer
On 4/1/2013 4:08 PM, Peter Ehlers wrote: On 2013-04-01 13:37, Ted Harding wrote: Greetings All. This is a somewhat generic query (I'm really asking on behalf of a friend who uses R on Windows, whereas I'm on Linux, but the same phenomenon appears on both). Say one has a largish dataframe -- cal

Re: [R] Help Please, ggplot2

2013-04-01 Thread Jeff Newmiller
Your example is not reproducible [1]. We don't know what device you are writing to, and we don't have your data or even a subset of it. However, facet_wrap is not used for generating separate graphs. You will need to make some kind of loop construct (for or lapply) that opens the device, prints

Re: [R] expression

2013-04-01 Thread Peter Ehlers
On 2013-04-01 12:46, Jose Narillos de Santos wrote: Hi all, I´m using titt<- expression(paste("R con ventanas de 200 ", italic(datos))) And it works properly on a plot(...,main=titt,..) But if I want to add an improvement to avoid typing n on the plot so that n<-200 titt<- expression(paste

Re: [R] Console display "buffer size"

2013-04-01 Thread Peter Ehlers
On 2013-04-01 13:37, Ted Harding wrote: Greetings All. This is a somewhat generic query (I'm really asking on behalf of a friend who uses R on Windows, whereas I'm on Linux, but the same phenomenon appears on both). Say one has a largish dataframe -- call it "G" -- which in the case under discus

Re: [R] expression

2013-04-01 Thread William Dunlap
Use bquote(), as in n <- 200 titt <- bquote(paste("R con ventanas de ", .(n), " ", italic(datos))) or, using ~ instead of paste(), titt <- bquote("R con ventanas de " ~ .(n) ~ italic(datos)) plot(1, 1, main=titt) The notation .(xxx) means to replace xxx by the value of the variable called

[R] Help Please, ggplot2

2013-04-01 Thread David Lyon
library(ggplot2) a<- read.table("data", header=T) b = na.omit(a) ggplot(data=b) + geom_line(aes(x=timepoint, y=value,group=sample, colour= factor(sample))) +  geom_point(aes(x=timepoint, y=value, group=s ample)) + facet_wrap(~bio, scales = "free",ncol = 5) +theme_bw() + opts(legend.direction = "h

[R] Console display "buffer size"

2013-04-01 Thread Ted Harding
Greetings All. This is a somewhat generic query (I'm really asking on behalf of a friend who uses R on Windows, whereas I'm on Linux, but the same phenomenon appears on both). Say one has a largish dataframe -- call it "G" -- which in the case under discussion has 592 rows and 41 columns. The inte

[R] This day in history: R-help, R-devel and R-announce (1997-04-01)

2013-04-01 Thread Henrik Bengtsson
Today it's 16 years ago and 367,496 messages later since MartinMächler started the R-help (321,119 msgs), R-devel (45,830 msgs) and R-announce (547 msgs) mailing lists [1] - a great benefit to all of us. Special thanks to Martin and also thanks to everyone else contributing to these forums. [1] h

Re: [R] Factor to numeric conversion - as.numeric(levels(f))[f] - Language definition seems to say to not use this.

2013-04-01 Thread Matthew Lundberg
Note the edited subject line! I don't know why I typed it as it was before. This says that as.numeric(as.character(f)) will work regardless of the implementation, and I agree. It's the recommendation to use as.numeric(levels(f))[f] that has me wondering about section 2.3.1 of the language defini

Re: [R] expression

2013-04-01 Thread Bert Gunter
?plotmath tells you how. -- Bert On Mon, Apr 1, 2013 at 12:46 PM, Jose Narillos de Santos wrote: > Hi all, > > I惴 using > > > titt<- expression(paste("R con ventanas de 200 ", italic(datos))) > > And it works properly on a plot(...,main=titt,..) > > But if I want to add an improvement to avoid

Re: [R] Factor to numeric conversion - as.numeric(as.character(f))[f] - Language definition seems to say to not use this.

2013-04-01 Thread Bert Gunter
Yup. Note also: > as.character.factor function (x, ...) levels(x)[x] But of course this is OK, since this can change if the implementation does. Which is the whole point, of course. -- Bert On Mon, Apr 1, 2013 at 12:16 PM, Matthew Lundberg wrote: > > When used as an index, the factor is impl

[R] expression

2013-04-01 Thread Jose Narillos de Santos
Hi all, I´m using titt<- expression(paste("R con ventanas de 200 ", italic(datos))) And it works properly on a plot(...,main=titt,..) But if I want to add an improvement to avoid typing n on the plot so that n<-200 titt<- expression(paste("R con ventanas de ",n, italic(datos))) It doesn´t

Re: [R] Factor to numeric conversion - as.numeric(as.character(f))[f] - Language definition seems to say to not use this.

2013-04-01 Thread Matthew Lundberg
When used as an index, the factor is implicitly converted to integer. In the expression as.numeric(levels(f))[f], the vector as.numeric(levels(f)) is indexed by as.integer(f). This appears to rely on the current implementation, as mentioned in section 2.3.1 of the language definition. On Mon, A

Re: [R] robust function

2013-04-01 Thread David Winsemius
On Apr 1, 2013, at 10:22 AM, Yolanda wrote: > I need to use the next robust functions: t1way, box1way and lincon. > I don't find these funcions in any library. Try: pkg:WRS install.packages("WRS", repos="http://R-Forge.R-project.org";, type="source")) > What libraries do I have to install?

Re: [R] Factor to numeric conversion - as.numeric(as.character(f))[f] - Language definition seems to say to not use this.

2013-04-01 Thread Peter Ehlers
On 2013-04-01 10:48, Matthew Lundberg wrote: These two seem to be at odds. Is this the case? From help(factor) - section Warning: To transform a factor f to approximately its original numeric values, as.numeric(levels(f))[f] is recommended and slightly more efficient than as.numeric(as.chara

Re: [R] Factor to numeric conversion - as.numeric(as.character(f))[f] - Language definition seems to say to not use this.

2013-04-01 Thread Ista Zahn
Hi Mathew, In what way are they at odds? On Mon, Apr 1, 2013 at 1:48 PM, Matthew Lundberg wrote: > These two seem to be at odds. Is this the case? > > >From help(factor) - section Warning: > > To transform a factor f to approximately its original numeric values, > as.numeric(levels(f))[f] is re

[R] 95% Confidence Interval for a p-p plot

2013-04-01 Thread pablo.castano
Hi, I want to create upper and lower 95% confidence intervals for a p-p plot of an empirical distribution with a theoretical gamma distribution. This is my code: x<-rgamma(100,shape=2, rate=1) # empirical data fitdistr(x,"gamma") # fit a gamma distribution dist<-pgamma(x,shape=1.9884256 ,rate=0

Re: [R] plot

2013-04-01 Thread Trying To learn again
Hi Many Thanks to all. dev.print(jpeg, file="test.jpeg", height=800,width=800) Works perfectly it saves in the default directory the jpeg file. I use RStudio. Many Thanks. 2013/4/1 David Winsemius > > On Apr 1, 2013, at 9:26 AM, R. Michael Weylandt wrote: > > > On Mon, Apr 1, 2013 at 5:05

[R] Factor to numeric conversion - as.numeric(as.character(f))[f] - Language definition seems to say to not use this.

2013-04-01 Thread Matthew Lundberg
These two seem to be at odds. Is this the case? >From help(factor) - section Warning: To transform a factor f to approximately its original numeric values, as.numeric(levels(f))[f] is recommended and slightly more efficient than as.numeric(as.character(f)). >From the language definition - secti

[R] robust function

2013-04-01 Thread Yolanda
I need to use the next robust functions: t1way, box1way and lincon. I don't find these funcions in any library. What libraries do I have to install? Thanks. Yolanda __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLE

[R] plm: Hausman Test error

2013-04-01 Thread londonphd
Hi, I am trying to run a panel regression using 88 observations and 9 variables. In-built Hausman Test did not work, then I found a code for auxiliary regression method for the Hausman test. The panel models are: fe=plm(gd ~ l+g+o+c+g1+h+n+r, model = "within", data = new.frame,index = c("id")) r

Re: [R] example to demonstrate benefits of poly in regression?

2013-04-01 Thread Paul Johnson
On Mon, Apr 1, 2013 at 12:42 PM, Gabor Grothendieck wrote: > On Mon, Apr 1, 2013 at 1:20 PM, Paul Johnson wrote: > > Here's my little discussion example for a quadratic regression: > > > > http://pj.freefaculty.org/R/WorkingExamples/regression-quadratic-1.R > > > > Students press me to know the

Re: [R] Is DUD available in nls()?

2013-04-01 Thread Bert Gunter
I certainly second all Jeff's comments. **HOWEVER** : http://www.tandfonline.com/doi/pdf/10.1080/00401706.1978.10489610 IIRC, DUD's provenance is old, being originally a BMDP feature. -- Bert On Mon, Apr 1, 2013 at 10:59 AM, Jeff Newmiller wrote: > a) Read the Posting Guide. It will tell you t

Re: [R] example to demonstrate benefits of poly in regression?

2013-04-01 Thread William Dunlap
Here is an example of the numerical instability that poly() can help with. Imagine a 100-minute experiment where you chose to record the times as POSIXt objects (stored as seconds since 1970). Using poly() gives the right predicted values, but using I(x^2) does not: > d <- data.frame(Date=as.

Re: [R] Is DUD available in nls()?

2013-04-01 Thread Jeff Newmiller
a) Read the Posting Guide. It will tell you things like: 1) Don't post in HTML format. Adjust your email client appropriately. 2) Don't repost. Your emails are all there, looking silly next to each other. 3) Use the search facilities yourself, such as RSiteSearch(). b) Regarding your "DUD" algorit

Re: [R] example to demonstrate benefits of poly in regression?

2013-04-01 Thread Gabor Grothendieck
On Mon, Apr 1, 2013 at 1:20 PM, Paul Johnson wrote: > Here's my little discussion example for a quadratic regression: > > http://pj.freefaculty.org/R/WorkingExamples/regression-quadratic-1.R > > Students press me to know the benefits of poly() over the more obvious > regression formulas. > > I thi

[R] lognormal sampleing using covariance matrix

2013-04-01 Thread Andras Farkas
Dear All,   wondering if someine can access the link to the randsamp code referenced in the R-help archive here: http://www.mail-archive.com/r-help@stat.math.ethz.ch/msg75645.html ? I have tried but for whatever reason I can not get trough. My problem seems to be  similar to what the author orig

[R] example to demonstrate benefits of poly in regression?

2013-04-01 Thread Paul Johnson
Here's my little discussion example for a quadratic regression: http://pj.freefaculty.org/R/WorkingExamples/regression-quadratic-1.R Students press me to know the benefits of poly() over the more obvious regression formulas. I think I understand the theory on why poly() should be more numericall

Re: [R] Data frame question

2013-04-01 Thread arun
Hi, Not sure if this is what you wanted: activity<- data.frame(Name=paste0("activity",LETTERS[1:5]),stringsAsFactors=FALSE) dates1<- data.frame(dat=as.Date(c("2013-02-01","2013-02-04","2013-02-05"),format="%Y-%m-%d")) merge(dates1,activity) #  dat  Name #1  2013-02-01 activityA #2  2

Re: [R] plot

2013-04-01 Thread David Winsemius
On Apr 1, 2013, at 9:26 AM, R. Michael Weylandt wrote: > On Mon, Apr 1, 2013 at 5:05 PM, Trying To learn again > wrote: >> Hi all if I plot a graph on R, I press on the plot Export/Save Plot as >> Image > > I assume this means you're using R-Studio? > >> >> I change name on "File name:" >

[R] Is DUD available in nls()?

2013-04-01 Thread qi A
SAS has DUD (Does not Use Derivatives)/Secant Method for nonlinear regression, does R offer this option for nonlinear regression? I have read the helpfile for nls() and could not find such option, any suggestion? Thanks, Derek [[alternative HTML version deleted]] __

Re: [R] plot

2013-04-01 Thread R. Michael Weylandt
On Mon, Apr 1, 2013 at 5:05 PM, Trying To learn again wrote: > Hi all if I plot a graph on R, I press on the plot Export/Save Plot as > Image I assume this means you're using R-Studio? > > I change name on "File name:" > > I select DirectoryBibliotecas\Documentos > > And select Width 800

Re: [R] plot

2013-04-01 Thread Sarah Goslee
See ?jpeg Sarah On Mon, Apr 1, 2013 at 12:05 PM, Trying To learn again wrote: > Hi all if I plot a graph on R, I press on the plot Export/Save Plot as > Image > > I change name on "File name:" > > I select DirectoryBibliotecas\Documentos > > And select Width 800 and Height 800 > > And fi

[R] plot

2013-04-01 Thread Trying To learn again
Hi all if I plot a graph on R, I press on the plot Export/Save Plot as Image I change name on "File name:" I select DirectoryBibliotecas\Documentos And select Width 800 and Height 800 And finally save in format JPEG It is posible to "type" code so that I can run my function and it is n

[R] ggplot2 label problem

2013-04-01 Thread catalin roibu
I have a problem to plot label (Year) only for significant values (in this case spoz and sneg). I use this code, but don't work with labels. library(ggplot2) ggplot(data1, aes(x = Year, y = value,fill=type,width=1))+ geom_bar(stat="identity",position="identity")+ scale_y_continuous(breaks = rou

Re: [R] Data frame question

2013-04-01 Thread Sarah Goslee
That sounds like a job for merge(). If you provide an actual reproducible example using dput(), then you will likely get some actual runnable code. Sarah On Mon, Apr 1, 2013 at 11:54 AM, ramoss wrote: > Hello, > > I have 2 data frames: activity and dates. Activity contains a l variable > list

[R] Data frame question

2013-04-01 Thread ramoss
Hello, I have 2 data frames: activity and dates. Activity contains a l variable listing all activities: activityA, activityB etc. The dates contain all the valid business dates. I need to combine the 2 so that I get a single data frame activitydat that contains the activity name along w/ evevr

[R] ggplot label problem

2013-04-01 Thread catalin roibu
Dear R users, I have a problem to plot label (Year) only for significant values (in this case spoz and sneg). I use this code, but don't work with labels. library(ggplot2) ggplot(data1, aes(x = Year, y = value,fill=type,width=1))+ geom_bar(stat="identity",position="identity")+ scale_y_continuou

[R] Image segmentation

2013-04-01 Thread Eder Paulo
Hi, I work with remote sensing in Brazil. I would like to know if there is any algorithm or package that does image segmentation by region growing in R. Thanks, Eder. [[alternative HTML version deleted]] _

Re: [R] Parameter Estimation in R with Sums and Lagged Variables

2013-04-01 Thread Mark Leeds
Hi: Google for koyck distributed lag. Based on what you wrote, I think that's what you're looking for or something close to it. There is tons of literature on that model and if you read enough about it, you'll see that through a transformation, reduces to something that much simpler to estimate.

[R] ggplot2 label

2013-04-01 Thread catalin roibu
Hello all! I have a problem to plot label (Year) only for significant values (in this case spoz and sneg). I use this code, but don't work with labels. library(ggplot2) ggplot(data1, aes(x = Year, y = value,fill=type,width=1))+ geom_bar(stat="identity",position="identity")+ scale_y_continuous(

[R] overlaping barplot

2013-04-01 Thread catalin roibu
Hello all! I want to make a barplot with ggplot2. I want to view in the same chart the semn values (significant values (pointer over 50)). I try this code, but only for pointer values. ggplot(data, aes(x = Year, y = pointer)) + geom_bar(stat="identity") please help me with this problem. I use

Re: [R] [Rd] R/Sweave/cairo/freetype bug fix.

2013-04-01 Thread Hin-Tak Leung
--- On Sat, 30/3/13, Hin-Tak Leung wrote: > "... was committed to freetype in January and will form the > next release (2.4.12)". It is perhaps worth repeating the quote: 'The official R binaries for windows ... are compiled against static libraries of cairo 1.10.2 ... are firmly in the "do

[R] test

2013-04-01 Thread catalin roibu
Sorry for this message it's just a test. Thank you! -- --- Catalin-Constantin ROIBU Lecturer PhD, Forestry engineer Forestry Faculty of Suceava Str. Universitatii no. 13, Suceava, 720229, Romania office phone +4 0230 52 29 78, ext. 531 mobile phone +4 0745 53 18 01 +

Re: [R] Error message in dredge function (MuMIn package) used with binary GLM

2013-04-01 Thread Kamil Bartoń
Hi Cat, are you using some very old version of MuMIn? That would explain the missing 'QAICc'. As for the error message about 'logLik', it usually occurs when there are some misspelled arguments (that go into "..." and are passed to the rank function, 'AICc' in your case). Check if there is some ar

Re: [R] [Rd] R/Sweave/cairo/freetype bug fix.

2013-04-01 Thread Simon Urbanek
On Apr 1, 2013, at 5:18 AM, Hin-Tak Leung wrote: > --- On Sat, 30/3/13, Hin-Tak Leung wrote: > >> "... was committed to freetype in January and will form the >> next release (2.4.12)". > > It is perhaps worth repeating the quote: 'The official R binaries for > windows ... are compiled again

Re: [R] polygon error

2013-04-01 Thread peter dalgaard
On Apr 1, 2013, at 10:56 , catalin roibu wrote: > Hello all! > > I have a problem to draw a polygon with R. My data is like this> > Year Nb.series Perc.pos Perc.neg Nature RGV_mean RGV_sd neg poz > 1 1901 1 0.00 0.00 0 4.29 NA 0.00 0.00 > 2 1902 1 100.00 0.00 1 16.47 NA 0.00 100.00 > 3 1903 1

[R] polygon error

2013-04-01 Thread catalin roibu
Hello all! I have a problem to draw a polygon with R. My data is like this> Year Nb.series Perc.pos Perc.neg Nature RGV_mean RGV_sd neg poz 1 1901 1 0.00 0.00 0 4.29 NA 0.00 0.00 2 1902 1 100.00 0.00 1 16.47 NA 0.00 100.00 3 1903 1 100.00 0.00 1 31.31 NA 0.00 100.00 4 1904 1 0.00 0.00 0 -9.62 N

[R] Parameter Estimation in R with Sums and Lagged Variables

2013-04-01 Thread Christian Satzky
Hi guys, I am afraid I am stuck with an estimation problem. I have two variables, X and Y. Y is explained by the weighted sum of n lagged values of X. My aim is to estimate the two parameters c(alpha0,alpha1) in: Yt = Sum from j=1 to n of ( ( alpha0 + alpha1 * j ) * Xt-j ) Where Xt-j denotes th