Hi there,

This is my first post on this forum.
I have set up rpy2 and tried to do Multiple Linear Regression, but my code 
doesn't work.
I think its just a syntax issue. I can't find any specific code for Multiple 
Linear Regression, so I just made an educated guess as to what the syntax is:

Hope someone can help.
(see code below)

Paulr

Example of Simple Linear Regression :(this works)
*********************************************
observed = R.r.FloatVector([...])
theoretical = R.r.FloatVector([...])
R.r.globalenv['observed'] = observed
R.r.globalenv['theoretical'] = theoretical

m = R.r.lm('theoretical ~ observed')

*********************************************

The code that I thought should work is below:
Multiple Linear Regression Example:(below,this throws an error)
-----------------------------------------------------------------------
//My code
Ydata =  R.r.FloatVector([...])
x1data = R.r.FloatVector([...])
x2data = R.r.FloatVector([...])

R.r.globalenv['Ydata'] = Ydata
R.r.globalenv['x1data'] = x1data
R.r.globalenv['x2data'] = x2data

//below I used something that is the way it is done in R
m = R.r.lm('Ydata ~ x1data + x2data') //error on this line

------------------------------------------------------------------------
                                          
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to