[R] Reading oxmetrics/pcgive files (.in7 & .bn7)

2015-01-26 Thread Mikael Olai Milhøj
Hi

I have the unfortune to have some data saved as oxmetrics/pcgive file
format (.in7 & .bn7). Is there any way to import data from this format into
R? I have tried both google and the importing/exporting guide without any
luck.

Thanks in advance

Best regards,

/Mikael

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] Reading oxmetrics/pcgive files (.in7 & .bn7)

2015-01-27 Thread Mikael Olai Milhøj
Hi John

This was really helpful! Exactly what I needed. Thank you very much - I
really appreciate it!


/Mikael

On Tue, Jan 27, 2015 at 11:54 PM, John C Frain  wrote:

> By way of an example, the ox code below reads the sample data.in7 (and
> data.bn7) distributed with the console version of Ox and outputs it as an
> Excel file.
>
>
> #include 
> #import 
> main()
> {
> decl dbase;
> dbase = new Database();
> dbase.Load("C:\Program Files (x86)\OxMetrics7\ox\data\data.in7");
> dbase.Info();
>
> dbase.SaveXls("E:/temp/ox/sample2_ox.xls");
> delete dbase;
> }
>
> John C Frain
> 3 Aranleigh Park
> Rathfarnham
> Dublin 14
> Ireland
> www.tcd.ie/Economics/staff/frainj/home.html
> mailto:fra...@tcd.ie
> mailto:fra...@gmail.com
>
> On 26 January 2015 at 21:50, Mikael Olai Milhøj 
> wrote:
>
>> Hi
>>
>> I have the unfortune to have some data saved as oxmetrics/pcgive file
>> format (.in7 & .bn7). Is there any way to import data from this format
>> into
>> R? I have tried both google and the importing/exporting guide without any
>> luck.
>>
>> Thanks in advance
>>
>> Best regards,
>>
>> /Mikael
>>
>> [[alternative HTML version deleted]]
>>
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> 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.
>>
>
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] Dropping time series observations

2015-01-31 Thread Mikael Olai Milhøj
Hi

Is there an easy way to drop, for instance, the first 4 observation of a
time series object in R? I have tried to google the answer without any
luck.

To be more clear:
Let us say that I have a time seres object x which data from 2000Q1 to
2014Q4 but I only want the data from 2001Q1 to 2014Q4.How do I remove the
first four elements?

By using x[5:?] R no longer recognize it as a ts.object.

Thank you

Best regards

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] Plot residuals against standard normal distribution

2015-02-02 Thread Mikael Olai Milhøj
Hi,

I'm having trouble trying to plot the density of the residuals against the
standard normal distribution N(0,1). (I'm trying to see if my residuals are
well-behaved).

I know hwo to calculate the standardized residuals (I guess that there may
be a simple way using a R function) and then plot this by using the density
function

y<-(model$residuals-mean(model$residuals))/sd(model$residuals)
plot(density(y))

But I don't know how to add the N(0,1) curve. Any suggestions? Thanks in
advance


/Mikael

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] Plot residuals against standard normal distribution

2015-02-03 Thread Mikael Olai Milhøj
Thx - this was exactly what I needed. Yes I also prefer the qqnorm but I
like the distrubution chart as well.
Thx !


/Mikael

On Tue, Feb 3, 2015 at 12:18 AM, peter dalgaard  wrote:

>
> > On 02 Feb 2015, at 23:42 , Mikael Olai Milhøj 
> wrote:
> >
> > Hi,
> >
> > I'm having trouble trying to plot the density of the residuals against
> the
> > standard normal distribution N(0,1). (I'm trying to see if my residuals
> are
> > well-behaved).
> >
> > I know hwo to calculate the standardized residuals (I guess that there
> may
> > be a simple way using a R function) and then plot this by using the
> density
> > function
> >
> > y<-(model$residuals-mean(model$residuals))/sd(model$residuals)
> > plot(density(y))
> >
> > But I don't know how to add the N(0,1) curve. Any suggestions? Thanks in
> > advance
>
> I'd try
>
> curve(dnorm(x), add=TRUE)
>
> Some diddling of ylim= is usually required.
>
>
> I'd usually prefer qqnorm() for normality checks, though; it is pretty
> hard to assess the tails of density plots.
>
> Also notice rstandard(), rstudent().
>
> -pd
>
> >
> >
> > /Mikael
> >
> >   [[alternative HTML version deleted]]
> >
> > __
> > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > 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.
>
> --
> Peter Dalgaard, Professor,
> Center for Statistics, Copenhagen Business School
> Solbjerg Plads 3, 2000 Frederiksberg, Denmark
> Phone: (+45)38153501
> Email: pd@cbs.dk  Priv: pda...@gmail.com
>
>
>
>
>
>
>
>
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] Dummy variable in ARIMA

2015-02-26 Thread Mikael Olai Milhøj
Hi all

I have been searching on the web in vain. I want to include a dummy
variable in my ARIMA model. Let's say that I want to make an AR(1) model
for X including a dummy variable which should be 1 for observation 4,5,6
and zero otherwise (let's say that there is 50 observations in total). How
do I make that?

This does the trick but seems inefficient: dummy<-c(rep(0,3), rep(1,3),
rep(0,44))

Thx in advance

Best regards
/Mikael

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] Dummy variable in ARIMA

2015-02-26 Thread Mikael Olai Milhøj
Hi.

First of all, thx. But when using in arima(...xreg=fact,...) then fact
should be a vector and not a factor variable? Maybe I should have been more
clear in my first mail, sorry. Or else I have to dig deeper into factors.


/Mikael

On Thu, Feb 26, 2015 at 5:17 PM, Bert Gunter  wrote:

> Inline.
>
> Cheers,
> Bert
>
> Bert Gunter
> Genentech Nonclinical Biostatistics
> (650) 467-7374
>
> "Data is not information. Information is not knowledge. And knowledge
> is certainly not wisdom."
> Clifford Stoll
>
>
>
>
> On Thu, Feb 26, 2015 at 8:02 AM, Mikael Olai Milhøj
>  wrote:
> > Hi all
> >
> > I have been searching on the web in vain. I want to include a dummy
> > variable in my ARIMA model. Let's say that I want to make an AR(1) model
> > for X including a dummy variable which should be 1 for observation 4,5,6
> > and zero otherwise (let's say that there is 50 observations in total).
> How
> > do I make that?
>
> You don't, really.
>
> 1. Go through an R tutorial so that you understand the concept of
> factors and how they are used in R modeling.
>
> 2. fact <- factor( (1:50) %in% (4:6))
>
> Cheers,
> Bert
>
> >
> > This does the trick but seems inefficient: dummy<-c(rep(0,3), rep(1,3),
> > rep(0,44))
> >
> > Thx in advance
> >
> > Best regards
> > /Mikael
> >
> > [[alternative HTML version deleted]]
> >
> > __
> > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > 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.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.