English 中文(简体)
如何从数据表中计算多变公式
原标题:How to calculate a multi-variable formula from a table of data
  • 时间:2010-07-21 16:12:50
  •  标签:
  • statistics

I have a table of several independent variables that I need to calculate a formula from to generate the dependent variable. Though trial I have come up with a value for the dependent variable. For example, I have a table like this:

x1 | x2 | x3 || z(value found by experiment)
-------------------
1  | 2  | 3  || 10
3  | 4  | 5  || 14
2  | 3  | 3  || 15
1  | 2  | 7  || 9

我现在想有一个这样的公式:

f(x1,x2,x3) = z

现在,我如何走下去,获得价值? 你们能否向我指出一些资源?

我感到,我从我的学日,但我想记住这一点。

<<>Also>: 你们是否知道对我来说这样做的任何工具? 我有前言,但我无法说明如何以不止一个变量来扭转。

问题回答

简单的办法是使用VBA,而不是复杂的回归方法。 您可使用多种变量,并取得多重结果

表(表1):

x1 is cell A1 in VBA sheet1.cells(1,1)
x2 is cell B1 in VBA sheet1.cells(1,2)
x3 is cell C1 in VBA sheet1.cells(1,3)
z is cell D1 in VBA sheet1.cells(1,4)

计算方法是第2版(表2);

cell A1 = x1 (variable; input for formulas)
cell A2 = x2 (variable; input for formulas)
cell A3 = x3 (variable; input for formulas)
cell A4 = z1 (result)

B. 创建Button和VBA的类型代码

Private Sub CommandButton1_Click()

 rowCount is numbers of rows in your table(list1)
for m = 0 to rowCount-1

      set table data to calculations
      set x1
     sheet2.Cells(1, 1) = sheet1.Cells(2 + m, 1)
      set x2
     sheet2.Cells(1, 2) = sheet1.Cells(2 + m, 2)
      set x3
     sheet2.Cells(1, 3) = sheet1.Cells(2 + m, 3)

      get z
     sheet1.Cells(2 + m, 4) = sheet2.Cells(1, 4)

next m
End Sub




相关问题
How to manage a pageview DB

I am interested in tracking my users pageviews on my site. Being that traffic is expanding very quickly, I am worried about robots, etc, and I also want to be able to use tracked data live to alter ...

Statistics Question

Suppose I conduct a survey of 10 people asking whether to rank a movie as 0 to 4 stars. Allowable answers are 0, 1, 2, 3, and 4. The mean is 2.0 stars. How do I calculate the certainty (or ...

Calculating variance with large numbers

I haven t really used variance calculation that much, and I don t know quite what to expect. Actually I m not too good with math at all. I have a an array of 1000000 random numeric values in the ...

R statistical package: wrapping GOFrame objects

I m trying to generate GOFrame objects to generate a gene ontology mapping in R for unsupported organisms (see http://www.bioconductor.org/packages/release/bioc/vignettes/GOstats/inst/doc/...

Generating correlated numbers

Here is a fun one: I need to generate random x/y pairs that are correlated at a given value of Pearson product moment correlation coefficient, or Pearson r. You can imagine this as two arrays, array ...

Multivariate time series modelling in R

I want do fit some sort of multi-variate time series model using R. Here is a sample of my data: u cci bci cpi gdp dum1 dum2 dum3 dx 16.50 14.00 53.00 45.70 80....

热门标签