Select to view content in your preferred language

How do I calculate a field using data from Excel

1861
11
02-14-2020 01:24 PM
jamesluscher
Emerging Contributor

Ran Ordinary Least Squares and the output table is in Excel. I am using the data from the 5 variables to predict the value in another data set with the same variables. I was hoping to have a calculated field where I could multiply the coefficient times the whole column for all 5 variables. Coefficient 1 times Variable 1, Coefficient 2 times variable 2, etc. Does anyone have any experience doing this?  

0 Kudos
11 Replies
DavidPike
MVP Notable Contributor

You could add the xls as a gdb table then use search and update cursors to do the calculations.

0 Kudos
jamesluscher
Emerging Contributor

Thank you. I am not well steeped in Python.

0 Kudos
DavidPike
MVP Notable Contributor

If you send some pictures of the tables and a comprehensive explanation of what you want to achieve, I can write it out.

0 Kudos
jamesluscher
Emerging Contributor

I am trying to calculate the tracts.Value field by using the below equation. I can do it once but, as soon as I run a different regression, I have to change all of the coefficients for each Variable. Furthermore, I have 20+ variables to use and, therefore, the number of variables can fluctuate. 

 

0 Kudos
DavidPike
MVP Notable Contributor

I'm sorry it's easily codeable but I still don't get the whole picture. 

0 Kudos
jamesluscher
Emerging Contributor

When I run the Ordinary Least Squares tool the result is a regression that is reported in OLS_Coefficients. The regression is based on home sales with a known sales price. I am trying to take the Coefficient of each variable and apply it to homes that we don't have sales data on. We have the same Variable but just don't know the price. 

0 Kudos
DavidPike
MVP Notable Contributor

So theres an OLS table for each row in the table in the second image?

0 Kudos
jamesluscher
Emerging Contributor

There is one OLS table for the whole "tracts" table. It is a one-to-many relationship. 

0 Kudos
DavidPike
MVP Notable Contributor

Are you saying you have multiple tables such as tracts and an ols table for each of them? 

0 Kudos