[R] Functions for autoregressive Regressionmodels (Mix between times series and Regression Models) ?

2007-08-07 Thread Maja Schröter
Hello everybody,

I've a question about "autoregressive Regressionmodels".

Let Y[1],.,Y[n], be a time series.

Given the model: 

Y[t] = phi[1]*Y[t-1] + phi[2]*Y[t-1] + ... + phi[p]*Y[t-p] + x_t^T*beta + u_t,


where x_t=(x[1t],x[2t],x[mt]) and beta=(beta[1],...,beta[m]) and u_t~(0,1)

I want to estimate the coefficients phi and beta.

Are in R any functions or packages for "autoregressive Regressionmodel" with 
special summaries?. I'm not meaning the function "ar".


Example: I have the data

working.time<- rnorm(100)   # Y
vacation<- rnorm(100)   #x1
bank.holidays   <- rnorm(100)   #x2
illnes  <- rnorm(100)   #x3
education   <- rnorm(100)   #x3



Now I want to analyse:

 Y[t] = phi[1]*Y[t-1] + phi[2]*Y[t-1] + ... + phi[p]Y[t-p] + beta1*vacation_t  
+beta2*bank.holidays + beta3*illnes + beta4*eductation + u_t-



Has anyone an idea? 

I would be more than glad if so.

Thank you VERY much in advance.

Kindly regards from the Eastern Part of Berlin,

Maja

--

__
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-contained, reproducible code.


Re: [R] Problems using "lm" in combination with "predict"

2007-08-04 Thread Maja Schröter
Hi, 

I am sorry


I meant:


  mod <- lm(y~Worktime+Vacation+Illnes+Bankholidays)
   
  newdate=data.frame(x=c(324,123,0.9,0.1))
  predict(mod,newdate)

And get this error.

Yours,

Maja




 Original-Nachricht 
Datum: Sat, 4 Aug 2007 04:42:14 -0700 (PDT)
Von: Stephen Tucker <[EMAIL PROTECTED]>
An: "Maja \\"Schröter\\"" <[EMAIL PROTECTED]>, r-help@stat.math.ethz.ch
Betreff: Re: [R]  Problems using "lm" in combination with "predict"

> I think you need 
> 
> predict(mod,newdate)
> 
> instead of 
> 
> predict(y,newdate)
> 
> 
> --- "Maja Schröter" <[EMAIL PROTECTED]> wrote:
> 
> > Hello everybody,
> > 
> > I'm trying to predict a linear regression model but it does not work.
> > 
> > My Model: y = Worktime + Vacation + Illnes + Bankholidays
> > 
> > My modelmatrix is of dimension  28x4
> > 
> > Then I want to make use of the function predict because there
> > confidence.intervals are include.
> > 
> > My idea was:
> > 
> > mod <- lm(y~Worktime+Vacation+Illnes+Bankholidays)
> > 
> > newdate=data.frame(x=c(324,123,0.9,0.1))
> > predict(y,newdate)
> > 
> > But I always get the message:
> > 
> > 
> > 'newdata' had 1 rows but variable(s) found have 28 rows
> > 
> > 
> > What can I do?
> > 
> > Yours, 
> > 
> > Maja
> > 
> > -- 
> > Pt! Schon vom neuen GMX MultiMessenger gehört?
> > Der kanns mit allen: http://www.gmx.net/de/go/multimessenger
> > 
> > __
> > 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-contained, reproducible code.
> > 
> 
> 
> 
>
> 
> Looking for a deal? Find great prices on flights and hotels with Yahoo!
> FareChase.
> http://farechase.yahoo.com/

-- 
Pt! Schon vom neuen GMX MultiMessenger gehört?
Der kanns mit allen: http://www.gmx.net/de/go/multimessenger

__
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-contained, reproducible code.


[R] Problems using "lm" in combination with "predict"

2007-08-04 Thread Maja Schröter
Hello everybody,

I'm trying to predict a linear regression model but it does not work.

My Model: y = Worktime + Vacation + Illnes + Bankholidays

My modelmatrix is of dimension  28x4

Then I want to make use of the function predict because there 
confidence.intervals are include.

My idea was:

mod <- lm(y~Worktime+Vacation+Illnes+Bankholidays)

newdate=data.frame(x=c(324,123,0.9,0.1))
predict(y,newdate)

But I always get the message:


'newdata' had 1 rows but variable(s) found have 28 rows


What can I do?

Yours, 

Maja

-- 
Pt! Schon vom neuen GMX MultiMessenger gehört?
Der kanns mit allen: http://www.gmx.net/de/go/multimessenger

__
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-contained, reproducible code.


[R] Text with differents colors in a plot / Detecting if text exists

2007-07-15 Thread Maja Schröter
Hi everybody,

I want to write some text in a plot.

That's simple I know. But I want to make use of different colors.

Eg. text(x,y,paste("Sunderland","high")).

Then Sunderland should be black and "high" red.

Has anyone an idea?

By the way. I'm looking for a function or something similar, that can check 
whether there is text in some regions on the plot. 
Because I don't want to overwrite an existing text with a new one.

Thank you so much for your help. I appologize in advance if my question is very 
stupid but I have really no idea.

Yours,

Maja
--

__
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-contained, reproducible code.


[R] How to start a R script from a dos command?

2007-07-01 Thread Maja Schröter
Hi everybody,

I want to start a R programm from a dos command.

Are there any possibilities that I can start e.g. the file "Test.R" from dos?

Maybe something like: R.exe -Test.R ?

Thank you very much!

Regards,

Maja 
--

__
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-contained, reproducible code.


[R] Highliting a text in a plot

2007-06-23 Thread Maja Schröter
Hi everyone,

I want to highlight something in a plot.
So I want to write a text with a yellow background.


I tried to make use of text(x,y,"hallo",bg="yellow")
but that does not work. 

I know I am a handful. Sorry!

Maja!
--

__
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-contained, reproducible code.


[R] Encircling a text in a plot

2007-06-23 Thread Maja Schröter
Hello everyone,

I want to write something in a plot with text or something similar, e.g. 
text(x,y,"something") but I want to encircle it by a box as in a legend.

I have absolutely no idea how this could work.

Thank you very much for your answers!

Maja
--

__
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-contained, reproducible code.


[R] [r

2007-06-23 Thread Maja Schröter

--

__
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-contained, reproducible code.


[R] Problems with Vista, R 2.5.0 and function save

2007-06-12 Thread Maja Schröter
Hi everyone,

I want to make use of the save function but it did not work.

I'm using vista and R 2.5.0, winzip is installed too.

Here's the code (from example ?save): 

  > x <- runif(20)
  > y <- list(a = 1, b = TRUE, c = "oops")
  > save(x, y, file = "xy.Rdata")
   Fehler in gzfile(file, "wb") : kann Verbindung nicht öffnen
Zusätzlich: Warning message:
kann komprimierte Datei 'xy.Rdata' nicht öffnen 

Thank you so much for your help.

Background: I want to crate a variable "masterfile" that I can start with 
data(masterfile) or attach(masterfile).

I.g. 

Town<-c("London","Miami","Rio","Lansing")
Pollution<-c("34","32","50","17")
masterfile<-data.frame(Town,Pollution)
save(masterfile,file="masterfile.Rda")


Kindly regards,

Maja Schröter
-- 
Pt! Schon vom neuen GMX MultiMessenger gehört?
Der kanns mit allen: http://www.gmx.net/de/go/multimessenger

__
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-contained, reproducible code.


[R] Starting R within an VBA makro

2007-06-10 Thread Maja Schröter
Hello everybody,

at work I want to start R within an VBA program. 

First I calculate something in Excel 2003.

After that I want to start within my VBA makro R wich should start an R file, 
say i.g, superplot.R  which plots me the data well.

So is it possible?

Maybe something like that:

sub test()

  'calculate something

 start R superplot.R 

end test()

Thank you so much.

Kindly regards,

Maja


-- 
Pt! Schon vom neuen GMX MultiMessenger gehört?
Der kanns mit allen: http://www.gmx.net/de/go/multimessenger

__
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-contained, reproducible code.


[R] German Map in package maps

2007-05-22 Thread Maja Schröter
Hello everybody,

I'm an absolute newbe in R, so please be gentle to me.

I am looking for a german map in the package maps by Becker and Wilks.

After that I want to draw the German cities from world.cities of this package 
in the map and want to draw further a line from Berlin to Munich.

Has anybody an idea?


Thank you so much and sorry for the question!

Best regards from Berlin,

Maja!

--

__
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-contained, reproducible code.


[R] How to increase decimal places

2006-11-12 Thread Maja Schröter
Hello everyone,

does anybody know how to increase the decimal places that R uses to calculate 
something.

I think that in default R uses 6 decimal places but I need 12.

Thank you very much!

Best regards,

Maja!
--

__
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-contained, reproducible code.


[R] Dividing objects in classes using function sample()

2006-09-02 Thread Maja Schröter
Hello everyone,

I've a problem and dont know how to solve. This is my first posting and it 
would be fantastic if you could help me.

I want to divide n objects in k classes and need an output with all 
(n+1)(n+2)/2 possibilities.

For example n=4, k=3:

That would be:
   
   4 0 0
   3 1 0
   3 0 1
   2 2 0
   2 1 1
   2 0 2
   1 3 0 
   1 2 1
   1 1 2
   1 0 3 
   0 3 1 
   0 2 2
   0 1 3
   0 0 4


I tried to you use permn() or sample() but I don't know how to solve.

Please help me!

Best regards,

Maja


-- 


"Feel free" – 10 GB Mailbox, 100 FreeSMS/Monat ...

__
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-contained, reproducible code.