#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

# How to use JASP for two-level factorial design in quality control module?

Hi,

I have three factors for chemical reaction which will give the result as yields.

Exp 9-13 are repetition of Exp 5.

I would like to find the main factors and confounding factors.

I would setup my generator as A B C AB AC BC ABC

The reason for experiment repetition is to find the confidence interval with 0.975 confidence of 4 degree of freedom.

I did this exercise in python and predict the yield when ratio,stir,OH conc is 2.6, 80, 44 respectively.

I want to know if I can do with JASP, I could not figure out how to use this module.

Thanks

from pyDOE2 import fracfact

import numpy as np

import matplotlib.pyplot as plt

import statistics

from scipy import stats

gen = 'aa a b c ab ac bc abc'

x = fracfact(gen)

ratio = [2,3]

stir = [60, 120]

conc = [40,45]

Y = [62.4, 66.2, 39.6, 76.6, 63.4, 75.2, 32.6, 80.0]

rep = [62.1, 66.2, 64.8, 62.2, 61.1]

b = 1/len(Y) * x.T @ Y

vb = 1/len(Y)*statistics.variance(rep)

sb = vb**0.5

t_stat = stats.t.ppf(0.975, 4)

conf = t_stat*sb

gen_lab = (gen.split())[1:len(Y)]

B_new = b[1:len(Y)]

plt.bar(gen_lab,B_new)

plt.axhline(y=conf,color="red")

plt.axhline(y=-conf,color="red")

plt.axhline(y=0,color="blue")

plt.show()

x1 = np.interp(2.6,[2,3],[-1,1])

x2 = np.interp(80,[60,120],[-1,1])

x3 = np.interp(44,[40,45],[-1,1])

yield_result = b[0] + b[1]*x1 + b[2]*x2 + 0*b[3]*x3 + b[4]*x1*x2 + b[5]*x1*x3 + 0*b[6]*x2*x3 + 0*b[7]*x1*x2*x3

print(yield_result)

• Hi Andy,

To analyze this kind of data you need to set up the dataset in a different way. You can use the DOE module to create a design with possible combinations of the factor levels. You can then use JASP to save this design and create a dataset with an empty response variable to fill in.

In your case, however, you already have a design that you want to analyze. This is also possible with the DOE module, but your dataset should have the structure as in the table you shared. Under "Design analysis" you can then drag the variables to the right field. The result should look like this:

Is this what you wanted to do? Let me know, I would also be very curious to hear whether the results you got in Python match the results in JASP!

Best,

Jonas