Re: plotting data in mschart
Change this line first:
Code:
Dim s0, s1, s2, t0, t1 As Double
As you are declaring only t1 as a Double, not them all!
Code:
Dim s0 As Double, s1 As Double, s2 As Double, t0 As Double, t1 As Double
And then try running it again!
1 Attachment(s)
Re: plotting data in mschart
Hi dglliena
I already change and nothing happen to my Regression result.(y=Mx-B) in my input which is x on that? Also my plot in graph is not straight from base on my screen shot.(pls. see attached file) Hope you can help me on this problem. Thanks.
Re: plotting data in mschart
I don't even see the values that you calculated for regression, etc...
Re: plotting data in mschart
Here is the code to get the Slope/Y intercept and Regrssion
and my inputs is on the first table in my screenshot
For X = 0 To 4
s0 = s0 + 1
s1 = s1 + CONC2(X)
s2 = s2 + (CONC2(X) * CONC2(X))
t0 = t0 + ABS2(X)
t1 = t1 + (CONC2(X) * ABS2(X))
''Plot Graph
Next
SlopeOrig = Format((s0 * t1 - s1 * t0) / (s0 * s2 - s1 * s1), "0.#000") 'slope formula M
YinterceptOrig = Format((s2 * t0 - s1 * t1) / (s0 * s2 - s1 * s1), "0.#000") 'Yintercept formula B
SlopeCorrected = Format((s0 * t1 - s1 * t0) / (s0 * s2 - s1 * s1), "0.#000")
Ycorrected = Format((s2 * t0 - s1 * t1) / (s0 * s2 - s1 * s1), "0.#000")
'Regression Formula y = Mx + b
RsquareCorrected = Format((SlopeCorrected ) + Ycorrected, "0.#000") ''''Regression computation
Re: plotting data in mschart
Try it in Excel to see what happens.
Re: plotting data in mschart
I already try that before in excel on how to have a straight line if your input the ff.data.in excel it used a xy scatter graph to have a straight line but my problem in VB is if i used xy scatter the last input would be plot under the first input unlike if i used line graph u will see the line of last input.did you get me?
Re: plotting data in mschart
Might be a resolution problem with the monitor, or else, VB6 can't do WPF properly, since it wasn't INVENTED yet
Re: plotting data in mschart
i see.how about the regression?how to get the regression base on my inputs?
Re: plotting data in mschart
Looks like
Code:
SlopeCorrected
Ycorrected
might be the problem...
Re: plotting data in mschart
The formula on that has a correct result of what we expect only the regression is not.