Skip to content
Back to formatted view

Raw Message

Message-ID: <A4E5A0B016B8CB41A485FC629B633CED47A5B6F3AF@GOLD.corp.lgc-group.com>
Date: 2012-10-09T15:19:40Z
From: S Ellison
Subject: How to write out this regression equation in R?
In-Reply-To: <OF7D28113F.FF3F38F7-ON85257A92.00526BE2-85257A92.0052C038@pwc.com>

> How to make R write out: 
> 
> Balance = 2 + 3 * IntGDP + 5 * IntUnemployment + 0.3 * d1
> 
> from the table below:
> 
> Balance         Intercept       IntGDP  GDPNum  IntUnemployment 
> IntInflation    d1      d2      d3
> 30000           2               3                       5  
> 0.3  0       0 


Maybe ?sprintf would help?

And if you wrap that in a function that takes a vector, using apply() on the table would give you one string per row,

*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}