similar to: Problems using "lm" in combination with "predict"

Displaying 20 results from an estimated 400 matches similar to: "Problems using "lm" in combination with "predict""

2007 Aug 07
1
Functions for autoregressive Regressionmodels (Mix between times series and Regression Models) ?
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
2013 Mar 30
1
How to use group in nested associations
The below query fails: Timesheet.joins(:time_entries).select("timesheets.*, sum(time_entries.worktime) as total").group("timesheets.start_date") The models have the following relations: Timesheet < AR has_many :activities, dependent: :destroy, inverse_of: :timesheet has_many :time_entries, through: :activities accepts_nested_attributes_for :activities,
2006 Oct 20
1
Questions about date/time and truncating
I'm getting a weird behavior using R 2.5.0 for MacOS X -- I have a csv file with a "properly formatted" date/time field, e.g. After reading in the csv to "hourly_met_data", with a "date" field hourly_met_data$date <- as.POSIXct(hourly_met_data$date) works exactly as it is supposed to (e.g. Min/max of that field are calculated correctly). However, when I
2004 May 26
2
Subtracting number of days from a date
Hi group, suppose I have a date, say May 15 2004, and I want to now what date it is 23 days before that date. The way to calculate the new date should (...) take account of leap years :) In pseudocode: olddate <- "May 15 2004" newdate <- olddate-23 I looked around in POSIXct etc..., maybe I overlooked? Thanks, Maarten
2013 Mar 25
1
validates presence of foreign key fails in nested form
I''m using accepts_nested_attributes as follows: class Timesheet < ActiveRecord::Base attr_accessible :status, :user_id, :start_date, :end_date, :activities_attributes has_many :activities, dependent: :destroy has_many :time_entries, through: :activities accepts_nested_attributes_for :activities, allow_destroy: true end class Activity < ActiveRecord::Base attr_accessible
2009 Mar 11
1
Is this a documentation bug? Spss dates import
Hello R-user bug seekers are needed! In order to perform these simple tasks you have to use a copy of SPSS and obviously R. The problem is that date conversion of data coming from SPSS gives wrong results, if we follow ?as.POSIXct ## SPSS dates (R-help 2006-02-17) z <- c(10485849600, 10477641600, 10561104000, 10562745600) as.Date(as.POSIXct(z, origin="1582-10-14",
2023 Nov 03
1
Sum data according to date in sequence
Is this what you are after? library(tidyverse) library(lubridate) input <- structure(list(StationName = c("PALO ALTO CA / CAMBRIDGE #1", "PALO ALTO CA / CAMBRIDGE #1", "PALO ALTO CA / CAMBRIDGE #1", "PALO ALTO CA / CAMBRIDGE #1", "PALO ALTO CA / CAMBRIDGE #1", "PALO ALTO CA / CAMBRIDGE #1", "PALO ALTO CA / CAMBRIDGE
2006 Jul 06
6
Help with overriding / overwriting date values in ActiveRecord to accept Euro Style Date from a Textbox
Hi guys, I''m trying to make an AR model which accepts a string data (from a text input) in euro date format eg <input .... value = "23/01/2006"> ( 23 Jan 2006) Reading the example from RDoc... i tried to overwrite/overload/override the = function to write in the date.. Cant get it to work because .. i dont knoe what format should it accept.. i''ve tried
2009 Mar 08
2
plot confidence limits of a regression line - problem
hi, I don't know what I am doing wrong, but with that code; x1 <- c(1.60, 0.27, 0.17, 1.63, 1.37, 2.00, 0.90, 1.07, 0.89, 0.43, 0.37, 0.59, 0.47, 1.83, 1.79, 0.90, 0.72, 1.83, 0.23, 1.97, 2.03, 2.19, 2.03, 0.86) x2 <- c(1.30, 0.24, 0.20, 0.50, 1.33, 1.87, 1.30, 0.75, 1.07, 0.43, 0.37, 0.87, 1.40, 1.37, 1.63, 0.80, 0.57, 1.60, 0.39, 2.03, 1.90, 2.07, 1.93, 0.93) model <-
2013 Jan 18
2
A smart way to use "$" in data frame
Hello all, I have a data frame dataa: newdate newstate newid newbalance newaccounts 1 31DEC2001 AR 1 1170 61 2 31DEC2001 VA 2 4565 54 3 31DEC2001 WA 3 2726 35 4 31DEC2001 AR 3 2700 35 The following gives me the balance of state AR:
2013 Mar 04
0
fields_for with accepts_nested_attributes: how to pass a value to a label
I can''t figure out how to pass a value from the following object build in the controller: class TimesheetsController < AC ... def new @timesheet = current_user.timesheets.new now = Date.today #generating 7 time entries: monday through sunday (now.beginning_of_week..now.end_of_week).step { |date| @timesheet.time_entries.build(:workdate; date) end end ... In the
2013 Mar 26
0
nested forms: use validate :some_method works in update mode only
I have a strange behavior when validating a record in a nested form. The association collection is empty when creating a new record and the validation does not catch the error. But when updating the same record the validation gets it right but continues to catch the error even after modifying the needed attribute value to make it pass. Here is the model: #timesheet.rb class Timesheet <
2013 Mar 04
2
accepts_nested_attributes: undefined method 'association'_attributes
I have 2 models Timesheet and TimeEntry: class Timesheet < ActiveRecord::Base attr_accessible :status, :user_id, :time_entries_attributes has_many :time_entries, dependent: :destroy accepts_nested_attributes_for :time_entries, :reject_if => proc { |attributes| attributes[''worktime''].blank? } end class TimeEntry < ActiveRecord::Base attr_accessible :task_id,
2007 Jun 11
1
Starting R within an VBA makro
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
2007 Jun 12
1
Problems with Vista, R 2.5.0 and function save
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:
2012 Apr 19
1
SmoothTrend in OpenAir
I'm trying to plot smooth trend using smoothTrend in OpenAir but I'm having problems. I used the following code. --------------------------------------------------------------------------------- #Set my working dir to the dir with my files setwd("c:/R") #Load the openair library library(openair) #Load the data mydata <- read.table("MCNP-pH.csv", header=TRUE,
2009 Jun 22
10
Could not find an installable distribution
Hi all, I am trying to install OpenSUSE 11.1 as a para-virtualized DomU on an opensolaris2009.06 guest using the xvm packages provided via IPS. I followed the instructions available here: http://www.opensolaris.org/os/community/xen/docs/virtinstall/ but I get the following error when trying to install from a NFS share where I mounted the iso (as far as I understand the only way to get a Linux
2013 Feb 11
2
Inserting rows of interpolated data
Dear help list - I have light data with 5-min time-stamps. I would like to insert four 1-min time-stamps between each row and interpolate the light data on each new row. To do this I have come up with the following code: lightdata <- read.table("Test_light_data.csv", header = TRUE, sep = ",") # read data file into object "lightdata" library(chron) mins <-
2017 Mar 26
5
[Euro LLVM] Unofficial beer before the conference
I like Tante Maja. I will call them and see if we can flood them. ;-) I suggest dinner at 18:00? Best, Tobias On Sun, Mar 26, 2017, at 04:08 PM, Bekket McClane via llvm-dev wrote: > Hi, I’m one of the poster session authors, I’m also currently in > Saarbruken > All three places sound nice to me, but I’m not familiar with this town so > maybe you can pick the place? > About the
2007 Jun 23
2
Highliting a text in a plot
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! --